From 009382ea032a772d7d59493d412c4e5e1c04c049 Mon Sep 17 00:00:00 2001 From: Geoffroy BONNEVILLE Date: Wed, 8 Apr 2020 15:27:40 +0200 Subject: [PATCH] Cleanup code --- .gitignore | 3 +- ModernKeePass.Application/Application.csproj | 10 ++++ .../Common/Interfaces/IDatabaseProxy.cs | 2 +- .../Common/Interfaces/IEntityVm.cs | 3 +- .../CreateDatabase/CreateDatabaseCommand.cs | 6 +-- .../SaveDatabase/SaveDatabaseCommand.cs | 39 +++++++++----- .../Database/Models/DatabaseVm.cs | 4 +- .../Queries/GetDatabase/GetDatabaseQuery.cs | 9 ++-- .../Queries/OpenDatabase/OpenDatabaseQuery.cs | 10 ++-- .../ReOpenDatabase/ReOpenDatabaseQuery.cs | 2 +- .../Commands/AddEntry/AddEntryCommand.cs | 17 ------ .../Properties/AssemblyInfo.cs | 2 - ModernKeePass.Domain/Domain.csproj | 10 ++++ ModernKeePass.Domain/Enums/EntryFieldName.cs | 2 +- .../Properties/AssemblyInfo.cs | 2 - .../Infrastructure.csproj | 10 ++++ .../KeePass/KeePassDatabaseClient.cs | 33 ++++-------- .../Properties/AssemblyInfo.cs | 2 - .../UWP/UwpRecentFilesClient.cs | 1 - .../KeePassDatabaseClientTests.cs | 2 +- ModernKeePass.sln | 54 ++++++++++--------- ModernKeePass/Package.StoreAssociation.xml | 25 ++++++++- ModernKeePass/Package.appxmanifest | 2 +- ModernKeePass/ViewModels/MainVm.cs | 1 - ModernKeePass/ViewModels/NewVm.cs | 12 ----- .../MainPageFrames/NewDatabasePage.xaml.cs | 10 ---- ModernKeePass/Win81App.csproj | 7 +-- 27 files changed, 142 insertions(+), 138 deletions(-) diff --git a/.gitignore b/.gitignore index 50f9252..ad9eec8 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,5 @@ packages/ project.lock.json AppPackages/ BundleArtifacts/ -*.DotSettings \ No newline at end of file +*.DotSettings +/ModernKeePass/Win81App_StoreKey.pfx diff --git a/ModernKeePass.Application/Application.csproj b/ModernKeePass.Application/Application.csproj index 1593c9c..be86d32 100644 --- a/ModernKeePass.Application/Application.csproj +++ b/ModernKeePass.Application/Application.csproj @@ -26,6 +26,16 @@ prompt 4 + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + x64 + pdbonly true diff --git a/ModernKeePass.Application/Common/Interfaces/IDatabaseProxy.cs b/ModernKeePass.Application/Common/Interfaces/IDatabaseProxy.cs index d61fa74..561e988 100644 --- a/ModernKeePass.Application/Common/Interfaces/IDatabaseProxy.cs +++ b/ModernKeePass.Application/Common/Interfaces/IDatabaseProxy.cs @@ -27,7 +27,7 @@ namespace ModernKeePass.Application.Common.Interfaces void CloseDatabase(); Task AddEntry(string parentGroupId, string entryId); - Task InsertEntry(string parentGroupId, string entryId, int messageIndex); + Task InsertEntry(string parentGroupId, string entryId, int index); Task AddGroup(string parentGroupId, string groupId); void UpdateEntry(string entryId, string fieldName, object fieldValue); void UpdateGroup(string groupId); diff --git a/ModernKeePass.Application/Common/Interfaces/IEntityVm.cs b/ModernKeePass.Application/Common/Interfaces/IEntityVm.cs index ab012b4..c6b12e0 100644 --- a/ModernKeePass.Application/Common/Interfaces/IEntityVm.cs +++ b/ModernKeePass.Application/Common/Interfaces/IEntityVm.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using ModernKeePass.Domain.Enums; +using ModernKeePass.Domain.Enums; namespace ModernKeePass.Application.Common.Interfaces { diff --git a/ModernKeePass.Application/Database/Commands/CreateDatabase/CreateDatabaseCommand.cs b/ModernKeePass.Application/Database/Commands/CreateDatabase/CreateDatabaseCommand.cs index 50182b4..0ddeccb 100644 --- a/ModernKeePass.Application/Database/Commands/CreateDatabase/CreateDatabaseCommand.cs +++ b/ModernKeePass.Application/Database/Commands/CreateDatabase/CreateDatabaseCommand.cs @@ -39,9 +39,9 @@ namespace ModernKeePass.Application.Database.Commands.CreateDatabase if (message.CreateSampleData) { - var bankingGroup = _database.CreateGroup(_database.RootGroupId, "Banking"); - var emailGroup = _database.CreateGroup(_database.RootGroupId, "Email"); - var internetGroup = _database.CreateGroup(_database.RootGroupId, "Internet"); + _database.CreateGroup(_database.RootGroupId, "Banking"); + _database.CreateGroup(_database.RootGroupId, "Email"); + _database.CreateGroup(_database.RootGroupId, "Internet"); var sample1 = _database.CreateEntry(_database.RootGroupId); _database.UpdateEntry(sample1.Id, EntryFieldName.Title, "Sample Entry" ); diff --git a/ModernKeePass.Application/Database/Commands/SaveDatabase/SaveDatabaseCommand.cs b/ModernKeePass.Application/Database/Commands/SaveDatabase/SaveDatabaseCommand.cs index 78f32e1..e3fa59f 100644 --- a/ModernKeePass.Application/Database/Commands/SaveDatabase/SaveDatabaseCommand.cs +++ b/ModernKeePass.Application/Database/Commands/SaveDatabase/SaveDatabaseCommand.cs @@ -1,4 +1,5 @@ -using MediatR; +using System; +using MediatR; using System.Threading.Tasks; using ModernKeePass.Application.Common.Interfaces; using ModernKeePass.Domain.Exceptions; @@ -24,22 +25,34 @@ namespace ModernKeePass.Application.Database.Commands.SaveDatabase { if (!_database.IsOpen) throw new DatabaseClosedException(); - byte[] contents; - if (string.IsNullOrEmpty(message.FilePath)) + try { - contents = await _database.SaveDatabase(); - await _file.WriteBinaryContentsToFile(_database.FileAccessToken, contents); + byte[] contents; + if (string.IsNullOrEmpty(message.FilePath)) + { + contents = await _database.SaveDatabase(); + + // Test DB integrity before writing changes to file + _database.CloseDatabase(); + var file = await _file.OpenBinaryFile(_database.FileAccessToken); + await _database.ReOpen(file); + + await _file.WriteBinaryContentsToFile(_database.FileAccessToken, contents); + } + else + { + var newFileContents = await _file.OpenBinaryFile(message.FilePath); + contents = await _database.SaveDatabase(newFileContents); + await _file.WriteBinaryContentsToFile(message.FilePath, contents); + + _file.ReleaseFile(_database.FileAccessToken); + _database.FileAccessToken = message.FilePath; + } } - else + catch (Exception exception) { - var newFileContents = await _file.OpenBinaryFile(message.FilePath); - contents = await _database.SaveDatabase(newFileContents); - await _file.WriteBinaryContentsToFile(message.FilePath, contents); - - _file.ReleaseFile(_database.FileAccessToken); - _database.FileAccessToken = message.FilePath; + throw new SaveException(exception); } - } } } diff --git a/ModernKeePass.Application/Database/Models/DatabaseVm.cs b/ModernKeePass.Application/Database/Models/DatabaseVm.cs index 1b583d9..8ad5e47 100644 --- a/ModernKeePass.Application/Database/Models/DatabaseVm.cs +++ b/ModernKeePass.Application/Database/Models/DatabaseVm.cs @@ -1,6 +1,4 @@ -using ModernKeePass.Application.Group.Models; - -namespace ModernKeePass.Application.Database.Models +namespace ModernKeePass.Application.Database.Models { public class DatabaseVm { diff --git a/ModernKeePass.Application/Database/Queries/GetDatabase/GetDatabaseQuery.cs b/ModernKeePass.Application/Database/Queries/GetDatabase/GetDatabaseQuery.cs index 6a76065..0bf6b0d 100644 --- a/ModernKeePass.Application/Database/Queries/GetDatabase/GetDatabaseQuery.cs +++ b/ModernKeePass.Application/Database/Queries/GetDatabase/GetDatabaseQuery.cs @@ -1,5 +1,4 @@ -using AutoMapper; -using MediatR; +using MediatR; using ModernKeePass.Application.Common.Interfaces; using ModernKeePass.Application.Database.Models; @@ -10,15 +9,13 @@ namespace ModernKeePass.Application.Database.Queries.GetDatabase public class GetDatabaseQueryHandler : IRequestHandler { private readonly IDatabaseProxy _databaseProxy; - private readonly IMapper _mapper; - public GetDatabaseQueryHandler(IDatabaseProxy databaseProxy, IMapper mapper) + public GetDatabaseQueryHandler(IDatabaseProxy databaseProxy) { _databaseProxy = databaseProxy; - _mapper = mapper; } - public DatabaseVm Handle(GetDatabaseQuery request) + public DatabaseVm Handle(GetDatabaseQuery message) { var database = new DatabaseVm { diff --git a/ModernKeePass.Application/Database/Queries/OpenDatabase/OpenDatabaseQuery.cs b/ModernKeePass.Application/Database/Queries/OpenDatabase/OpenDatabaseQuery.cs index 6f1b5fc..ace9e79 100644 --- a/ModernKeePass.Application/Database/Queries/OpenDatabase/OpenDatabaseQuery.cs +++ b/ModernKeePass.Application/Database/Queries/OpenDatabase/OpenDatabaseQuery.cs @@ -23,17 +23,17 @@ namespace ModernKeePass.Application.Database.Queries.OpenDatabase _file = file; } - public async Task Handle(OpenDatabaseQuery request) + public async Task Handle(OpenDatabaseQuery message) { if (_database.IsOpen) throw new DatabaseOpenException(); - var file = await _file.OpenBinaryFile(request.FilePath); + var file = await _file.OpenBinaryFile(message.FilePath); await _database.Open(file, new Credentials { - KeyFileContents = !string.IsNullOrEmpty(request.KeyFilePath) ? await _file.OpenBinaryFile(request.KeyFilePath): null, - Password = request.Password + KeyFileContents = !string.IsNullOrEmpty(message.KeyFilePath) ? await _file.OpenBinaryFile(message.KeyFilePath): null, + Password = message.Password }); - _database.FileAccessToken = request.FilePath; + _database.FileAccessToken = message.FilePath; } } diff --git a/ModernKeePass.Application/Database/Queries/ReOpenDatabase/ReOpenDatabaseQuery.cs b/ModernKeePass.Application/Database/Queries/ReOpenDatabase/ReOpenDatabaseQuery.cs index aed9273..ebcf46f 100644 --- a/ModernKeePass.Application/Database/Queries/ReOpenDatabase/ReOpenDatabaseQuery.cs +++ b/ModernKeePass.Application/Database/Queries/ReOpenDatabase/ReOpenDatabaseQuery.cs @@ -18,7 +18,7 @@ namespace ModernKeePass.Application.Database.Queries.ReOpenDatabase _file = file; } - public async Task Handle(ReOpenDatabaseQuery request) + public async Task Handle(ReOpenDatabaseQuery message) { if (!_database.IsOpen) throw new DatabaseClosedException(); diff --git a/ModernKeePass.Application/Group/Commands/AddEntry/AddEntryCommand.cs b/ModernKeePass.Application/Group/Commands/AddEntry/AddEntryCommand.cs index ed5f90e..3be713a 100644 --- a/ModernKeePass.Application/Group/Commands/AddEntry/AddEntryCommand.cs +++ b/ModernKeePass.Application/Group/Commands/AddEntry/AddEntryCommand.cs @@ -24,23 +24,6 @@ namespace ModernKeePass.Application.Group.Commands.AddEntry public async Task Handle(AddEntryCommand message) { if (!_database.IsOpen) throw new DatabaseClosedException(); - /*var entryEntity = new EntryEntity - { - Id = message.Entry.Id, - Name = message.Entry.Title, - UserName = message.Entry.Username, - Password = message.Entry.Password, - Url = message.Entry.Url, - Notes = message.Entry.Notes, - HasExpirationDate = message.Entry.HasExpirationDate, - ExpirationDate = message.Entry.ExpirationDate, - LastModificationDate = message.Entry.ModificationDate, - BackgroundColor = message.Entry.BackgroundColor, - ForegroundColor = message.Entry.ForegroundColor, - Icon = message.Entry.Icon, - AdditionalFields = message.Entry.AdditionalFields, - History = message.Entry.History - };*/ await _database.AddEntry(message.ParentGroup.Id, message.Entry.Id); message.ParentGroup.Entries.Add(message.Entry); diff --git a/ModernKeePass.Application/Properties/AssemblyInfo.cs b/ModernKeePass.Application/Properties/AssemblyInfo.cs index dac2789..2730264 100644 --- a/ModernKeePass.Application/Properties/AssemblyInfo.cs +++ b/ModernKeePass.Application/Properties/AssemblyInfo.cs @@ -1,7 +1,5 @@ using System.Resources; using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information diff --git a/ModernKeePass.Domain/Domain.csproj b/ModernKeePass.Domain/Domain.csproj index 5abf703..416d70a 100644 --- a/ModernKeePass.Domain/Domain.csproj +++ b/ModernKeePass.Domain/Domain.csproj @@ -26,6 +26,16 @@ prompt 4 + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + x64 + pdbonly true diff --git a/ModernKeePass.Domain/Enums/EntryFieldName.cs b/ModernKeePass.Domain/Enums/EntryFieldName.cs index 4b89c83..eeec7e7 100644 --- a/ModernKeePass.Domain/Enums/EntryFieldName.cs +++ b/ModernKeePass.Domain/Enums/EntryFieldName.cs @@ -1,6 +1,6 @@ namespace ModernKeePass.Domain.Enums { - public class EntryFieldName + public static class EntryFieldName { public const string Title = nameof(Title); public const string UserName = nameof(UserName); diff --git a/ModernKeePass.Domain/Properties/AssemblyInfo.cs b/ModernKeePass.Domain/Properties/AssemblyInfo.cs index 8e6bb49..69294db 100644 --- a/ModernKeePass.Domain/Properties/AssemblyInfo.cs +++ b/ModernKeePass.Domain/Properties/AssemblyInfo.cs @@ -1,7 +1,5 @@ using System.Resources; using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information diff --git a/ModernKeePass.Infrastructure/Infrastructure.csproj b/ModernKeePass.Infrastructure/Infrastructure.csproj index 5581c41..2d4fe90 100644 --- a/ModernKeePass.Infrastructure/Infrastructure.csproj +++ b/ModernKeePass.Infrastructure/Infrastructure.csproj @@ -34,6 +34,16 @@ prompt 4 + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + x64 + pdbonly true diff --git a/ModernKeePass.Infrastructure/KeePass/KeePassDatabaseClient.cs b/ModernKeePass.Infrastructure/KeePass/KeePassDatabaseClient.cs index 577f468..971e59d 100644 --- a/ModernKeePass.Infrastructure/KeePass/KeePassDatabaseClient.cs +++ b/ModernKeePass.Infrastructure/KeePass/KeePassDatabaseClient.cs @@ -6,7 +6,6 @@ using ModernKeePass.Application.Common.Interfaces; using ModernKeePass.Domain.Dtos; using ModernKeePass.Domain.Entities; using ModernKeePass.Domain.Enums; -using ModernKeePass.Domain.Exceptions; using ModernKeePass.Domain.Interfaces; using ModernKeePassLib; using ModernKeePassLib.Cryptography.KeyDerivation; @@ -126,6 +125,8 @@ namespace ModernKeePass.Infrastructure.KeePass _pwDatabase.Name = name; _pwDatabase.RootGroup.Name = name; + _credentials = credentials; + switch (version) { case DatabaseVersion.V4: @@ -142,34 +143,20 @@ namespace ModernKeePass.Infrastructure.KeePass public async Task SaveDatabase() { - try + return await Task.Run(() => { - return await Task.Run(() => - { - _pwDatabase.Save(new NullStatusLogger()); - return _pwDatabase.IOConnectionInfo.Bytes; - }); - } - catch (Exception e) - { - throw new SaveException(e); - } + _pwDatabase.Save(new NullStatusLogger()); + return _pwDatabase.IOConnectionInfo.Bytes; + }); } public async Task SaveDatabase(byte[] newFileContents) { - try + return await Task.Run(() => { - return await Task.Run(() => - { - _pwDatabase.SaveAs(IOConnectionInfo.FromByteArray(newFileContents), true, new NullStatusLogger()); - return _pwDatabase.IOConnectionInfo.Bytes; - }); - } - catch (Exception e) - { - throw new SaveException(e); - } + _pwDatabase.SaveAs(IOConnectionInfo.FromByteArray(newFileContents), true, new NullStatusLogger()); + return _pwDatabase.IOConnectionInfo.Bytes; + }); } public void CloseDatabase() diff --git a/ModernKeePass.Infrastructure/Properties/AssemblyInfo.cs b/ModernKeePass.Infrastructure/Properties/AssemblyInfo.cs index 437fcf1..a8690a8 100644 --- a/ModernKeePass.Infrastructure/Properties/AssemblyInfo.cs +++ b/ModernKeePass.Infrastructure/Properties/AssemblyInfo.cs @@ -1,7 +1,5 @@ using System.Resources; using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information diff --git a/ModernKeePass.Infrastructure/UWP/UwpRecentFilesClient.cs b/ModernKeePass.Infrastructure/UWP/UwpRecentFilesClient.cs index bf7280c..3dbf956 100644 --- a/ModernKeePass.Infrastructure/UWP/UwpRecentFilesClient.cs +++ b/ModernKeePass.Infrastructure/UWP/UwpRecentFilesClient.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using Windows.Storage.AccessCache; using ModernKeePass.Application.Common.Interfaces; diff --git a/ModernKeePass.KeePassDatabaseTests/KeePassDatabaseClientTests.cs b/ModernKeePass.KeePassDatabaseTests/KeePassDatabaseClientTests.cs index d45a00c..8bde4e5 100644 --- a/ModernKeePass.KeePassDatabaseTests/KeePassDatabaseClientTests.cs +++ b/ModernKeePass.KeePassDatabaseTests/KeePassDatabaseClientTests.cs @@ -70,7 +70,7 @@ namespace ModernKeePass.KeePassDatabaseTests var path = Path.Combine(Path.GetTempPath(), "NewDatabase.kdbx"); var newFile = await _fileProxy.OpenBinaryFile(path); - await _database.Create(newFile, _credentials); + await _database.Create(_credentials, "NewDatabase"); var result = await _database.SaveDatabase(); await _fileProxy.WriteBinaryContentsToFile(path, result); _database.CloseDatabase(); diff --git a/ModernKeePass.sln b/ModernKeePass.sln index dccec74..64edd36 100644 --- a/ModernKeePass.sln +++ b/ModernKeePass.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29911.84 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Win81App", "ModernKeePass\Win81App.csproj", "{A0CFC681-769B-405A-8482-0CDEE595A91F}" EndProject @@ -11,6 +11,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{107C7C00 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution items", "{3779FC26-0435-4823-81F5-3F27A525E991}" ProjectSection(SolutionItems) = preProject + .gitignore = .gitignore + LICENSE = LICENSE PRIVACY = PRIVACY README.md = README.md UpdateVersion.ps1 = UpdateVersion.ps1 @@ -94,50 +96,50 @@ Global {7E80F5E7-724A-4668-9333-B10F5D75C6D0}.Release|x86.Deploy.0 = Release|x86 {42353562-5E43-459C-8E3E-2F21E575261D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {42353562-5E43-459C-8E3E-2F21E575261D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {42353562-5E43-459C-8E3E-2F21E575261D}.Debug|ARM.ActiveCfg = Debug|Any CPU - {42353562-5E43-459C-8E3E-2F21E575261D}.Debug|ARM.Build.0 = Debug|Any CPU - {42353562-5E43-459C-8E3E-2F21E575261D}.Debug|x64.ActiveCfg = Debug|Any CPU - {42353562-5E43-459C-8E3E-2F21E575261D}.Debug|x64.Build.0 = Debug|Any CPU + {42353562-5E43-459C-8E3E-2F21E575261D}.Debug|ARM.ActiveCfg = Debug|ARM + {42353562-5E43-459C-8E3E-2F21E575261D}.Debug|ARM.Build.0 = Debug|ARM + {42353562-5E43-459C-8E3E-2F21E575261D}.Debug|x64.ActiveCfg = Debug|x64 + {42353562-5E43-459C-8E3E-2F21E575261D}.Debug|x64.Build.0 = Debug|x64 {42353562-5E43-459C-8E3E-2F21E575261D}.Debug|x86.ActiveCfg = Debug|Any CPU {42353562-5E43-459C-8E3E-2F21E575261D}.Debug|x86.Build.0 = Debug|Any CPU {42353562-5E43-459C-8E3E-2F21E575261D}.Release|Any CPU.ActiveCfg = Release|Any CPU {42353562-5E43-459C-8E3E-2F21E575261D}.Release|Any CPU.Build.0 = Release|Any CPU - {42353562-5E43-459C-8E3E-2F21E575261D}.Release|ARM.ActiveCfg = Release|Any CPU - {42353562-5E43-459C-8E3E-2F21E575261D}.Release|ARM.Build.0 = Release|Any CPU - {42353562-5E43-459C-8E3E-2F21E575261D}.Release|x64.ActiveCfg = Release|Any CPU - {42353562-5E43-459C-8E3E-2F21E575261D}.Release|x64.Build.0 = Release|Any CPU + {42353562-5E43-459C-8E3E-2F21E575261D}.Release|ARM.ActiveCfg = Release|ARM + {42353562-5E43-459C-8E3E-2F21E575261D}.Release|ARM.Build.0 = Release|ARM + {42353562-5E43-459C-8E3E-2F21E575261D}.Release|x64.ActiveCfg = Release|x64 + {42353562-5E43-459C-8E3E-2F21E575261D}.Release|x64.Build.0 = Release|x64 {42353562-5E43-459C-8E3E-2F21E575261D}.Release|x86.ActiveCfg = Release|Any CPU {42353562-5E43-459C-8E3E-2F21E575261D}.Release|x86.Build.0 = Release|Any CPU {9A0759F1-9069-4841-99E3-3BEC44E17356}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9A0759F1-9069-4841-99E3-3BEC44E17356}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9A0759F1-9069-4841-99E3-3BEC44E17356}.Debug|ARM.ActiveCfg = Debug|Any CPU - {9A0759F1-9069-4841-99E3-3BEC44E17356}.Debug|ARM.Build.0 = Debug|Any CPU - {9A0759F1-9069-4841-99E3-3BEC44E17356}.Debug|x64.ActiveCfg = Debug|Any CPU - {9A0759F1-9069-4841-99E3-3BEC44E17356}.Debug|x64.Build.0 = Debug|Any CPU + {9A0759F1-9069-4841-99E3-3BEC44E17356}.Debug|ARM.ActiveCfg = Debug|ARM + {9A0759F1-9069-4841-99E3-3BEC44E17356}.Debug|ARM.Build.0 = Debug|ARM + {9A0759F1-9069-4841-99E3-3BEC44E17356}.Debug|x64.ActiveCfg = Debug|x64 + {9A0759F1-9069-4841-99E3-3BEC44E17356}.Debug|x64.Build.0 = Debug|x64 {9A0759F1-9069-4841-99E3-3BEC44E17356}.Debug|x86.ActiveCfg = Debug|Any CPU {9A0759F1-9069-4841-99E3-3BEC44E17356}.Debug|x86.Build.0 = Debug|Any CPU {9A0759F1-9069-4841-99E3-3BEC44E17356}.Release|Any CPU.ActiveCfg = Release|Any CPU {9A0759F1-9069-4841-99E3-3BEC44E17356}.Release|Any CPU.Build.0 = Release|Any CPU - {9A0759F1-9069-4841-99E3-3BEC44E17356}.Release|ARM.ActiveCfg = Release|Any CPU - {9A0759F1-9069-4841-99E3-3BEC44E17356}.Release|ARM.Build.0 = Release|Any CPU - {9A0759F1-9069-4841-99E3-3BEC44E17356}.Release|x64.ActiveCfg = Release|Any CPU - {9A0759F1-9069-4841-99E3-3BEC44E17356}.Release|x64.Build.0 = Release|Any CPU + {9A0759F1-9069-4841-99E3-3BEC44E17356}.Release|ARM.ActiveCfg = Release|ARM + {9A0759F1-9069-4841-99E3-3BEC44E17356}.Release|ARM.Build.0 = Release|ARM + {9A0759F1-9069-4841-99E3-3BEC44E17356}.Release|x64.ActiveCfg = Release|x64 + {9A0759F1-9069-4841-99E3-3BEC44E17356}.Release|x64.Build.0 = Release|x64 {9A0759F1-9069-4841-99E3-3BEC44E17356}.Release|x86.ActiveCfg = Release|Any CPU {9A0759F1-9069-4841-99E3-3BEC44E17356}.Release|x86.Build.0 = Release|Any CPU {09577E4C-4899-45B9-BF80-1803D617CCAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {09577E4C-4899-45B9-BF80-1803D617CCAE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {09577E4C-4899-45B9-BF80-1803D617CCAE}.Debug|ARM.ActiveCfg = Debug|Any CPU - {09577E4C-4899-45B9-BF80-1803D617CCAE}.Debug|ARM.Build.0 = Debug|Any CPU - {09577E4C-4899-45B9-BF80-1803D617CCAE}.Debug|x64.ActiveCfg = Debug|Any CPU - {09577E4C-4899-45B9-BF80-1803D617CCAE}.Debug|x64.Build.0 = Debug|Any CPU + {09577E4C-4899-45B9-BF80-1803D617CCAE}.Debug|ARM.ActiveCfg = Debug|ARM + {09577E4C-4899-45B9-BF80-1803D617CCAE}.Debug|ARM.Build.0 = Debug|ARM + {09577E4C-4899-45B9-BF80-1803D617CCAE}.Debug|x64.ActiveCfg = Debug|x64 + {09577E4C-4899-45B9-BF80-1803D617CCAE}.Debug|x64.Build.0 = Debug|x64 {09577E4C-4899-45B9-BF80-1803D617CCAE}.Debug|x86.ActiveCfg = Debug|Any CPU {09577E4C-4899-45B9-BF80-1803D617CCAE}.Debug|x86.Build.0 = Debug|Any CPU {09577E4C-4899-45B9-BF80-1803D617CCAE}.Release|Any CPU.ActiveCfg = Release|Any CPU {09577E4C-4899-45B9-BF80-1803D617CCAE}.Release|Any CPU.Build.0 = Release|Any CPU - {09577E4C-4899-45B9-BF80-1803D617CCAE}.Release|ARM.ActiveCfg = Release|Any CPU - {09577E4C-4899-45B9-BF80-1803D617CCAE}.Release|ARM.Build.0 = Release|Any CPU - {09577E4C-4899-45B9-BF80-1803D617CCAE}.Release|x64.ActiveCfg = Release|Any CPU - {09577E4C-4899-45B9-BF80-1803D617CCAE}.Release|x64.Build.0 = Release|Any CPU + {09577E4C-4899-45B9-BF80-1803D617CCAE}.Release|ARM.ActiveCfg = Release|ARM + {09577E4C-4899-45B9-BF80-1803D617CCAE}.Release|ARM.Build.0 = Release|ARM + {09577E4C-4899-45B9-BF80-1803D617CCAE}.Release|x64.ActiveCfg = Release|x64 + {09577E4C-4899-45B9-BF80-1803D617CCAE}.Release|x64.Build.0 = Release|x64 {09577E4C-4899-45B9-BF80-1803D617CCAE}.Release|x86.ActiveCfg = Release|Any CPU {09577E4C-4899-45B9-BF80-1803D617CCAE}.Release|x86.Build.0 = Release|Any CPU {52FEA1EE-2FA7-4862-85FE-CB05893D439E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU diff --git a/ModernKeePass/Package.StoreAssociation.xml b/ModernKeePass/Package.StoreAssociation.xml index 860d03a..886d5a0 100644 --- a/ModernKeePass/Package.StoreAssociation.xml +++ b/ModernKeePass/Package.StoreAssociation.xml @@ -364,5 +364,28 @@ - + + + + 6.3.0.0 + Neutral + 1.15.2557.0 + + + 6.3.0.0 + Neutral + 1.15.2557.0 + + + 6.3.0.0 + Neutral + 1.15.2557.0 + + + 6.3.0.0 + Neutral + 1.15.2557.0 + + + \ No newline at end of file diff --git a/ModernKeePass/Package.appxmanifest b/ModernKeePass/Package.appxmanifest index 3368f3d..426f5a5 100644 --- a/ModernKeePass/Package.appxmanifest +++ b/ModernKeePass/Package.appxmanifest @@ -1,6 +1,6 @@  - + ModernKeePass wismna diff --git a/ModernKeePass/ViewModels/MainVm.cs b/ModernKeePass/ViewModels/MainVm.cs index 22f4ab0..f3bd7ea 100644 --- a/ModernKeePass/ViewModels/MainVm.cs +++ b/ModernKeePass/ViewModels/MainVm.cs @@ -74,7 +74,6 @@ namespace ModernKeePass.ViewModels Title = resource.GetResourceValue("MainMenuItemNew"), PageType = typeof(NewDatabasePage), Destination = destinationFrame, - Parameter = referenceFrame, SymbolIcon = Symbol.Add }, new MainMenuItemVm diff --git a/ModernKeePass/ViewModels/NewVm.cs b/ModernKeePass/ViewModels/NewVm.cs index 01944c4..4e4253b 100644 --- a/ModernKeePass/ViewModels/NewVm.cs +++ b/ModernKeePass/ViewModels/NewVm.cs @@ -1,14 +1,10 @@ using Windows.Storage; -using MediatR; -using Microsoft.Extensions.DependencyInjection; using ModernKeePass.Application.Common.Interfaces; namespace ModernKeePass.ViewModels { public class NewVm : OpenVm { - private readonly IMediator _mediator; - private readonly ISettingsProxy _settings; private string _importFormatHelp; public bool IsImportChecked { get; set; } @@ -28,13 +24,5 @@ namespace ModernKeePass.ViewModels OnPropertyChanged(nameof(ImportFormatHelp)); } } - - public NewVm(): this(App.Services.GetService(), App.Services.GetService()) { } - - public NewVm(IMediator mediator, ISettingsProxy settings) - { - _mediator = mediator; - _settings = settings; - } } } diff --git a/ModernKeePass/Views/MainPageFrames/NewDatabasePage.xaml.cs b/ModernKeePass/Views/MainPageFrames/NewDatabasePage.xaml.cs index 836757a..7e78eca 100644 --- a/ModernKeePass/Views/MainPageFrames/NewDatabasePage.xaml.cs +++ b/ModernKeePass/Views/MainPageFrames/NewDatabasePage.xaml.cs @@ -4,10 +4,8 @@ using Windows.Storage.AccessCache; using Windows.Storage.Pickers; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Navigation; using ModernKeePass.Common; using ModernKeePass.Domain.Dtos; -using ModernKeePass.Events; using ModernKeePass.Infrastructure.File; using ModernKeePass.ViewModels; @@ -20,20 +18,12 @@ namespace ModernKeePass.Views /// public sealed partial class NewDatabasePage { - private Frame _mainFrame; - public NewVm Model => (NewVm)DataContext; public NewDatabasePage() { InitializeComponent(); } - - protected override void OnNavigatedTo(NavigationEventArgs e) - { - base.OnNavigatedTo(e); - _mainFrame = e.Parameter as Frame; - } private async void CreateDatabaseButton_OnClick(object sender, RoutedEventArgs e) { diff --git a/ModernKeePass/Win81App.csproj b/ModernKeePass/Win81App.csproj index 8cba96b..3b7db92 100644 --- a/ModernKeePass/Win81App.csproj +++ b/ModernKeePass/Win81App.csproj @@ -14,10 +14,10 @@ 12 512 {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - ModernKeePass_StoreKey.pfx - ED3AA34F46D03498F989901C5DB2742B65D72F60 + Win81App_StoreKey.pfx + 2F2C96140E5F198DC331284960C96B3174A25070 True - x64 + x86|x64|arm Always @@ -238,6 +238,7 @@ Designer +