Save error is now handled via Messenger instead of unhandled exception handler (which didn't work)

Save as actually works now
WIP Styles
Code cleanup
This commit is contained in:
Geoffroy BONNEVILLE
2020-05-04 12:48:27 +02:00
parent 97b10baedc
commit 1e7662def7
33 changed files with 268 additions and 268 deletions

View File

@@ -27,11 +27,11 @@ namespace ModernKeePass.Application.Database.Queries.OpenDatabase
{
if (_database.IsDirty) throw new DatabaseOpenException();
var file = await _file.OpenBinaryFile(message.FilePath);
var file = await _file.ReadBinaryFile(message.FilePath);
var hasKeyFile = !string.IsNullOrEmpty(message.KeyFilePath);
await _database.Open(file, new Credentials
{
KeyFileContents = hasKeyFile ? await _file.OpenBinaryFile(message.KeyFilePath): null,
KeyFileContents = hasKeyFile ? await _file.ReadBinaryFile(message.KeyFilePath): null,
Password = message.Password
});
if (hasKeyFile) _file.ReleaseFile(message.KeyFilePath);

View File

@@ -23,7 +23,7 @@ namespace ModernKeePass.Application.Database.Queries.ReOpenDatabase
if (_database.IsOpen) throw new DatabaseOpenException();
if (string.IsNullOrEmpty(_database.FileAccessToken)) throw new DatabaseClosedException();
var file = await _file.OpenBinaryFile(_database.FileAccessToken);
var file = await _file.ReadBinaryFile(_database.FileAccessToken);
await _database.ReOpen(file);
}
}