WIP on data binding, nothing is working...

This commit is contained in:
2017-09-12 18:20:32 +02:00
parent 4487f0343f
commit 1cd7c0411c
33 changed files with 1397 additions and 1373 deletions

View File

@@ -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;
}
}*/
}
}
}

View File

@@ -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;
}
}

View File

@@ -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;