mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-04 08:00:16 -04:00
WIP on data binding, nothing is working...
This commit is contained in:
@@ -42,8 +42,8 @@ namespace ModernKeePassLib.Serialization
|
||||
|
||||
public override byte[] ReadBytes(int count)
|
||||
{
|
||||
try
|
||||
{
|
||||
/*try
|
||||
{*/
|
||||
byte[] pb = base.ReadBytes(count);
|
||||
if((pb == null) || (pb.Length != count))
|
||||
{
|
||||
@@ -52,12 +52,12 @@ namespace ModernKeePassLib.Serialization
|
||||
}
|
||||
|
||||
return pb;
|
||||
}
|
||||
catch(Exception)
|
||||
/*}
|
||||
catch(Exception ex)
|
||||
{
|
||||
if(m_strReadExcp != null) throw new IOException(m_strReadExcp);
|
||||
else throw;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -252,15 +252,12 @@ namespace ModernKeePassLib.Serialization
|
||||
{
|
||||
try
|
||||
{
|
||||
var sampleFile = await StorageFile.GetFileFromPathAsync(ioc.Path);
|
||||
using (IRandomAccessStream stream = await sampleFile.OpenAsync(FileAccessMode.Read))
|
||||
{
|
||||
return stream.AsStream();
|
||||
}
|
||||
IRandomAccessStream stream = await ioc.StorageFile.OpenAsync(FileAccessMode.Read);
|
||||
return stream.AsStream();
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.Assert(false, "Not implemented yet");
|
||||
Debug.Assert(false, ex.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@@ -27,6 +27,7 @@ using System.Diagnostics;
|
||||
|
||||
using ModernKeePassLib.Interfaces;
|
||||
using ModernKeePassLib.Utility;
|
||||
using Windows.Storage;
|
||||
|
||||
namespace ModernKeePassLib.Serialization
|
||||
{
|
||||
@@ -62,9 +63,11 @@ namespace ModernKeePassLib.Serialization
|
||||
|
||||
public sealed class IOConnectionInfo : IDeepCloneable<IOConnectionInfo>
|
||||
{
|
||||
// private IOFileFormatHint m_ioHint = IOFileFormatHint.None;
|
||||
// private IOFileFormatHint m_ioHint = IOFileFormatHint.None;
|
||||
|
||||
private string m_strUrl = string.Empty;
|
||||
public StorageFile StorageFile { get; set; }
|
||||
|
||||
private string m_strUrl = string.Empty;
|
||||
public string Path
|
||||
{
|
||||
get { return m_strUrl; }
|
||||
@@ -296,7 +299,18 @@ namespace ModernKeePassLib.Serialization
|
||||
return ioc;
|
||||
}
|
||||
|
||||
public bool CanProbablyAccess()
|
||||
public static IOConnectionInfo FromFile(StorageFile file)
|
||||
{
|
||||
IOConnectionInfo ioc = new IOConnectionInfo();
|
||||
|
||||
ioc.Path = file.Path;
|
||||
ioc.CredSaveMode = IOCredSaveMode.NoSave;
|
||||
ioc.StorageFile = file;
|
||||
|
||||
return ioc;
|
||||
}
|
||||
|
||||
public bool CanProbablyAccess()
|
||||
{
|
||||
Debug.Assert(false, "not yet implemented");
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user