1st working version in clean arch

WIP Parent group mapping issues
This commit is contained in:
Geoffroy BONNEVILLE
2020-03-30 19:43:04 +02:00
parent d1ba73ee9d
commit e4bd788ed3
54 changed files with 319 additions and 283 deletions

View File

@@ -42,6 +42,7 @@
<Compile Include="ApplicationModule.cs" /> <Compile Include="ApplicationModule.cs" />
<Compile Include="Common\Interfaces\ICryptographyClient.cs" /> <Compile Include="Common\Interfaces\ICryptographyClient.cs" />
<Compile Include="Common\Interfaces\IDatabaseProxy.cs" /> <Compile Include="Common\Interfaces\IDatabaseProxy.cs" />
<Compile Include="Common\Interfaces\IEntityVm.cs" />
<Compile Include="Common\Interfaces\IFileProxy.cs" /> <Compile Include="Common\Interfaces\IFileProxy.cs" />
<Compile Include="Common\Interfaces\IImportFormat.cs" /> <Compile Include="Common\Interfaces\IImportFormat.cs" />
<Compile Include="Common\Interfaces\IPasswordProxy.cs" /> <Compile Include="Common\Interfaces\IPasswordProxy.cs" />

View File

@@ -1,6 +1,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using ModernKeePass.Domain.Dtos; using ModernKeePass.Domain.Dtos;
using ModernKeePass.Domain.Entities; using ModernKeePass.Domain.Entities;
using ModernKeePass.Domain.Enums;
namespace ModernKeePass.Application.Common.Interfaces namespace ModernKeePass.Application.Common.Interfaces
{ {
@@ -18,7 +19,7 @@ namespace ModernKeePass.Application.Common.Interfaces
Task<GroupEntity> Open(FileInfo fileInfo, Credentials credentials); Task<GroupEntity> Open(FileInfo fileInfo, Credentials credentials);
Task<GroupEntity> ReOpen(); Task<GroupEntity> ReOpen();
Task<GroupEntity> Create(FileInfo fileInfo, Credentials credentials); Task<GroupEntity> Create(FileInfo fileInfo, Credentials credentials, DatabaseVersion version = DatabaseVersion.V2);
Task SaveDatabase(); Task SaveDatabase();
Task SaveDatabase(string filePath); Task SaveDatabase(string filePath);
void SetRecycleBin(string id); void SetRecycleBin(string id);

View File

@@ -0,0 +1,11 @@
using ModernKeePass.Domain.Enums;
namespace ModernKeePass.Application.Common.Interfaces
{
public interface IEntityVm
{
string Id { get; set; }
string Title { get; set; }
Icon Icon { get; set; }
}
}

View File

@@ -1,5 +1,4 @@
using MediatR; using MediatR;
using System.Threading.Tasks;
using ModernKeePass.Application.Common.Interfaces; using ModernKeePass.Application.Common.Interfaces;
using ModernKeePass.Domain.Exceptions; using ModernKeePass.Domain.Exceptions;
@@ -7,7 +6,7 @@ namespace ModernKeePass.Application.Database.Commands.CloseDatabase
{ {
public class CloseDatabaseCommand: IRequest public class CloseDatabaseCommand: IRequest
{ {
public class CloseDatabaseCommandHandler : IAsyncRequestHandler<CloseDatabaseCommand> public class CloseDatabaseCommandHandler : IRequestHandler<CloseDatabaseCommand>
{ {
private readonly IDatabaseProxy _database; private readonly IDatabaseProxy _database;
@@ -15,7 +14,7 @@ namespace ModernKeePass.Application.Database.Commands.CloseDatabase
{ {
_database = database; _database = database;
} }
public async Task Handle(CloseDatabaseCommand message) public void Handle(CloseDatabaseCommand message)
{ {
if (_database.IsOpen) _database.CloseDatabase(); if (_database.IsOpen) _database.CloseDatabase();
else throw new DatabaseClosedException(); else throw new DatabaseClosedException();

View File

@@ -23,15 +23,18 @@ namespace ModernKeePass.Application.Database.Queries.GetDatabase
{ {
var database = new DatabaseVm var database = new DatabaseVm
{ {
IsOpen = _databaseProxy.IsOpen, IsOpen = _databaseProxy.IsOpen
Name = _databaseProxy.Name,
RootGroup = _mapper.Map<GroupVm>(_databaseProxy.RootGroup),
IsRecycleBinEnabled = _databaseProxy.IsRecycleBinEnabled,
RecycleBin = _mapper.Map<GroupVm>(_databaseProxy.RecycleBin),
Compression = _databaseProxy.Compression,
CipherId = _databaseProxy.CipherId,
KeyDerivationId = _databaseProxy.CipherId
}; };
if (database.IsOpen)
{
database.Name = _databaseProxy.Name;
database.RootGroup = _mapper.Map<GroupVm>(_databaseProxy.RootGroup);
database.IsRecycleBinEnabled = _databaseProxy.IsRecycleBinEnabled;
database.RecycleBin = _mapper.Map<GroupVm>(_databaseProxy.RecycleBin);
database.Compression = _databaseProxy.Compression;
database.CipherId = _databaseProxy.CipherId;
database.KeyDerivationId = _databaseProxy.CipherId;
}
return database; return database;
} }
} }

View File

@@ -1,5 +1,4 @@
using System.Reflection; using System.Reflection;
using AutoMapper;
using FluentValidation; using FluentValidation;
using MediatR; using MediatR;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@@ -11,7 +10,6 @@ namespace ModernKeePass.Application
public static IServiceCollection AddApplication(this IServiceCollection services) public static IServiceCollection AddApplication(this IServiceCollection services)
{ {
var assembly = typeof(DependencyInjection).GetTypeInfo().Assembly; var assembly = typeof(DependencyInjection).GetTypeInfo().Assembly;
services.AddAutoMapper(assembly);
services.AddMediatR(assembly); services.AddMediatR(assembly);
//services.AddValidatorsFromAssembly(assembly); //services.AddValidatorsFromAssembly(assembly);

View File

@@ -2,14 +2,17 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using AutoMapper; using AutoMapper;
using ModernKeePass.Application.Common.Interfaces;
using ModernKeePass.Application.Common.Mappings; using ModernKeePass.Application.Common.Mappings;
using ModernKeePass.Application.Group.Models;
using ModernKeePass.Domain.Entities; using ModernKeePass.Domain.Entities;
using ModernKeePass.Domain.Enums; using ModernKeePass.Domain.Enums;
namespace ModernKeePass.Application.Entry.Models namespace ModernKeePass.Application.Entry.Models
{ {
public class EntryVm: IMapFrom<EntryEntity> public class EntryVm: IEntityVm, IMapFrom<EntryEntity>
{ {
public GroupVm ParentGroup { get; set; }
public string Id { get; set; } public string Id { get; set; }
public string Title { get; set; } public string Title { get; set; }
public string Username { get; set; } public string Username { get; set; }
@@ -28,6 +31,7 @@ namespace ModernKeePass.Application.Entry.Models
public void Mapping(Profile profile) public void Mapping(Profile profile)
{ {
profile.CreateMap<EntryEntity, EntryVm>() profile.CreateMap<EntryEntity, EntryVm>()
.ForMember(d => d.ParentGroup, opts => opts.MapFrom(s => s.Parent))
.ForMember(d => d.Id, opts => opts.MapFrom(s => s.Id)) .ForMember(d => d.Id, opts => opts.MapFrom(s => s.Id))
.ForMember(d => d.Title, opts => opts.MapFrom(s => s.Name)) .ForMember(d => d.Title, opts => opts.MapFrom(s => s.Name))
.ForMember(d => d.Username, opts => opts.MapFrom(s => s.UserName)) .ForMember(d => d.Username, opts => opts.MapFrom(s => s.UserName))

View File

@@ -1,31 +1,40 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using AutoMapper; using AutoMapper;
using ModernKeePass.Application.Common.Interfaces;
using ModernKeePass.Application.Common.Mappings; using ModernKeePass.Application.Common.Mappings;
using ModernKeePass.Application.Entry.Models; using ModernKeePass.Application.Entry.Models;
using ModernKeePass.Domain.Entities; using ModernKeePass.Domain.Entities;
using ModernKeePass.Domain.Enums; using ModernKeePass.Domain.Enums;
using ModernKeePass.Domain.Interfaces;
namespace ModernKeePass.Application.Group.Models namespace ModernKeePass.Application.Group.Models
{ {
public class GroupVm: IMapFrom<GroupEntity> public class GroupVm: IEntityVm, ISelectableModel, IMapFrom<GroupEntity>
{ {
public GroupVm ParentGroup { get; set; }
public string Id { get; set; } public string Id { get; set; }
public string Title { get; set; } public string Title { get; set; }
public Icon Icon { get; set; } public Icon Icon { get; set; }
public GroupVm ParentGroup { get; set; } public List<GroupVm> SubGroups { get; set; }
public List<GroupVm> SubGroups { get; set; } = new List<GroupVm>(); public List<EntryVm> Entries { get; set; }
public List<EntryVm> Entries { get; set; } = new List<EntryVm>(); public bool IsSelected { get; set; }
public override string ToString()
{
return Title;
}
public void Mapping(Profile profile) public void Mapping(Profile profile)
{ {
profile.CreateMap<GroupEntity, GroupVm>() profile.CreateMap<GroupEntity, GroupVm>()
.ForMember(d => d.ParentGroup, opts => opts.MapFrom(s => s.Parent))
.ForMember(d => d.Id, opts => opts.MapFrom(s => s.Id)) .ForMember(d => d.Id, opts => opts.MapFrom(s => s.Id))
.ForMember(d => d.Title, opts => opts.MapFrom(s => s.Name)) .ForMember(d => d.Title, opts => opts.MapFrom(s => s.Name))
.ForMember(d => d.Icon, opts => opts.MapFrom(s => s.Icon)) .ForMember(d => d.Icon, opts => opts.MapFrom(s => s.Icon))
.ForMember(d => d.ParentGroup, opts => opts.MapFrom(s => s.Parent))
.ForMember(d => d.Entries, opts => opts.MapFrom(s => s.Entries.OrderBy(e => e.Name))) .ForMember(d => d.Entries, opts => opts.MapFrom(s => s.Entries.OrderBy(e => e.Name)))
.ForMember(d => d.SubGroups, opts => opts.MapFrom(s => s.SubGroups)); .ForMember(d => d.SubGroups, opts => opts.MapFrom(s => s.SubGroups));
} }
} }
} }

View File

@@ -1,18 +1,8 @@
using AutoMapper; namespace ModernKeePass.Application.Parameters.Models
using ModernKeePass.Application.Common.Mappings;
using ModernKeePass.Domain.Entities;
namespace ModernKeePass.Application.Cryptography.Models
{ {
public class CipherVm: IMapFrom<BaseEntity> public class CipherVm
{ {
public string Id { get; set; } public string Id { get; set; }
public string Name { get; set; } public string Name { get; set; }
public void Mapping(Profile profile)
{
profile.CreateMap<BaseEntity, CipherVm>()
.ForMember(d => d.Id, opts => opts.MapFrom(s => s.Id))
.ForMember(d => d.Name, opts => opts.MapFrom(s => s.Name));
}
} }
} }

View File

@@ -1,19 +1,9 @@
using AutoMapper; namespace ModernKeePass.Application.Parameters.Models
using ModernKeePass.Application.Common.Mappings;
using ModernKeePass.Domain.Entities;
namespace ModernKeePass.Application.Cryptography.Models
{ {
public class KeyDerivationVm : IMapFrom<BaseEntity> public class KeyDerivationVm
{ {
public string Id { get; set; } public string Id { get; set; }
public string Name { get; set; } public string Name { get; set; }
public void Mapping(Profile profile)
{
profile.CreateMap<BaseEntity, CipherVm>()
.ForMember(d => d.Id, opts => opts.MapFrom(s => s.Id))
.ForMember(d => d.Name, opts => opts.MapFrom(s => s.Name));
}
} }
} }

View File

@@ -1,27 +1,29 @@
using System.Collections.Generic; using System.Collections.Generic;
using AutoMapper; using System.Linq;
using MediatR; using MediatR;
using ModernKeePass.Application.Common.Interfaces; using ModernKeePass.Application.Common.Interfaces;
using ModernKeePass.Application.Cryptography.Models; using ModernKeePass.Application.Parameters.Models;
namespace ModernKeePass.Application.Cryptography.Queries.GetCiphers namespace ModernKeePass.Application.Parameters.Queries.GetCiphers
{ {
public class GetCiphersQuery: IRequest<IEnumerable<CipherVm>> public class GetCiphersQuery: IRequest<IEnumerable<CipherVm>>
{ {
public class GetCiphersQueryHandler: IRequestHandler<GetCiphersQuery, IEnumerable<CipherVm>> public class GetCiphersQueryHandler: IRequestHandler<GetCiphersQuery, IEnumerable<CipherVm>>
{ {
private readonly ICryptographyClient _cryptography; private readonly ICryptographyClient _cryptography;
private readonly IMapper _mapper;
public GetCiphersQueryHandler(ICryptographyClient cryptography, IMapper mapper) public GetCiphersQueryHandler(ICryptographyClient cryptography)
{ {
_cryptography = cryptography; _cryptography = cryptography;
_mapper = mapper;
} }
public IEnumerable<CipherVm> Handle(GetCiphersQuery message) public IEnumerable<CipherVm> Handle(GetCiphersQuery message)
{ {
yield return _mapper.Map<CipherVm>(_cryptography.Ciphers); return _cryptography.Ciphers.Select(c => new CipherVm
{
Id = c.Id,
Name = c.Name
});
} }
} }
} }

View File

@@ -3,7 +3,7 @@ using System.Linq;
using MediatR; using MediatR;
using ModernKeePass.Application.Common.Interfaces; using ModernKeePass.Application.Common.Interfaces;
namespace ModernKeePass.Application.Cryptography.Queries.GetCompressions namespace ModernKeePass.Application.Parameters.Queries.GetCompressions
{ {
public class GetCompressionsQuery : IRequest<IEnumerable<string>> public class GetCompressionsQuery : IRequest<IEnumerable<string>>
{ {

View File

@@ -1,27 +1,29 @@
using System.Collections.Generic; using System.Collections.Generic;
using AutoMapper; using System.Linq;
using MediatR; using MediatR;
using ModernKeePass.Application.Common.Interfaces; using ModernKeePass.Application.Common.Interfaces;
using ModernKeePass.Application.Cryptography.Models; using ModernKeePass.Application.Parameters.Models;
namespace ModernKeePass.Application.Cryptography.Queries.GetKeyDerivations namespace ModernKeePass.Application.Parameters.Queries.GetKeyDerivations
{ {
public class GetKeyDerivationsQuery : IRequest<IEnumerable<KeyDerivationVm>> public class GetKeyDerivationsQuery : IRequest<IEnumerable<KeyDerivationVm>>
{ {
public class GetKeyDerivationsQueryHandler : IRequestHandler<GetKeyDerivationsQuery, IEnumerable<KeyDerivationVm>> public class GetKeyDerivationsQueryHandler : IRequestHandler<GetKeyDerivationsQuery, IEnumerable<KeyDerivationVm>>
{ {
private readonly ICryptographyClient _cryptography; private readonly ICryptographyClient _cryptography;
private readonly IMapper _mapper;
public GetKeyDerivationsQueryHandler(ICryptographyClient cryptography, IMapper mapper) public GetKeyDerivationsQueryHandler(ICryptographyClient cryptography)
{ {
_cryptography = cryptography; _cryptography = cryptography;
_mapper = mapper;
} }
public IEnumerable<KeyDerivationVm> Handle(GetKeyDerivationsQuery message) public IEnumerable<KeyDerivationVm> Handle(GetKeyDerivationsQuery message)
{ {
yield return _mapper.Map<KeyDerivationVm>(_cryptography.KeyDerivations); return _cryptography.KeyDerivations.Select(c => new KeyDerivationVm
{
Id = c.Id,
Name = c.Name
});
} }
} }
} }

View File

@@ -3,7 +3,7 @@
"dependencies": { "dependencies": {
"Autofac": "4.9.4", "Autofac": "4.9.4",
"Autofac.Extensions.DependencyInjection": "4.4.0", "Autofac.Extensions.DependencyInjection": "4.4.0",
"AutoMapper": "6.1.1", "AutoMapper": "6.0.2",
"AutoMapper.Extensions.Microsoft.DependencyInjection": "2.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "2.0.1",
"FluentValidation": "8.6.2", "FluentValidation": "8.6.2",
"MediatR": "3.0.1", "MediatR": "3.0.1",

View File

@@ -47,6 +47,7 @@
<Compile Include="Entities\EntryEntity.cs" /> <Compile Include="Entities\EntryEntity.cs" />
<Compile Include="Entities\GroupEntity.cs" /> <Compile Include="Entities\GroupEntity.cs" />
<Compile Include="Enums\CredentialStatusTypes.cs" /> <Compile Include="Enums\CredentialStatusTypes.cs" />
<Compile Include="Enums\DatabaseVersion.cs" />
<Compile Include="Enums\EntryFieldName.cs" /> <Compile Include="Enums\EntryFieldName.cs" />
<Compile Include="Enums\Icon.cs" /> <Compile Include="Enums\Icon.cs" />
<Compile Include="Enums\ImportFormat.cs" /> <Compile Include="Enums\ImportFormat.cs" />

View File

@@ -0,0 +1,8 @@
namespace ModernKeePass.Domain.Enums
{
public enum DatabaseVersion
{
V2,
V4
}
}

View File

@@ -1,6 +1,4 @@
using System.Reflection; using Microsoft.Extensions.DependencyInjection;
using AutoMapper;
using Microsoft.Extensions.DependencyInjection;
using ModernKeePass.Application.Common.Interfaces; using ModernKeePass.Application.Common.Interfaces;
using ModernKeePass.Domain.Interfaces; using ModernKeePass.Domain.Interfaces;
using ModernKeePass.Infrastructure.Common; using ModernKeePass.Infrastructure.Common;
@@ -13,9 +11,6 @@ namespace ModernKeePass.Infrastructure
{ {
public static IServiceCollection AddInfrastructure(this IServiceCollection services) public static IServiceCollection AddInfrastructure(this IServiceCollection services)
{ {
var assembly = typeof(DependencyInjection).GetTypeInfo().Assembly;
services.AddAutoMapper(assembly);
services.AddSingleton(typeof(IDatabaseProxy), typeof(KeePassDatabaseClient)); services.AddSingleton(typeof(IDatabaseProxy), typeof(KeePassDatabaseClient));
services.AddTransient(typeof(ICryptographyClient), typeof(KeePassCryptographyClient)); services.AddTransient(typeof(ICryptographyClient), typeof(KeePassCryptographyClient));
services.AddTransient(typeof(IPasswordProxy), typeof(KeePassPasswordClient)); services.AddTransient(typeof(IPasswordProxy), typeof(KeePassPasswordClient));

View File

@@ -19,6 +19,7 @@ namespace ModernKeePass.Infrastructure.KeePass
{ {
Uri url; Uri url;
CreateMap<PwEntry, EntryEntity>() CreateMap<PwEntry, EntryEntity>()
//.ForMember(dest => dest.Parent, opt => opt.MapFrom(src => src.ParentGroup))
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.Uuid.ToHexString())) .ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.Uuid.ToHexString()))
.ForMember(dest => dest.Name, opt => opt.MapFrom(src => GetEntryValue(src, PwDefs.TitleField))) .ForMember(dest => dest.Name, opt => opt.MapFrom(src => GetEntryValue(src, PwDefs.TitleField)))
.ForMember(dest => dest.UserName, opt => opt.MapFrom(src => GetEntryValue(src, PwDefs.UserNameField))) .ForMember(dest => dest.UserName, opt => opt.MapFrom(src => GetEntryValue(src, PwDefs.UserNameField)))
@@ -37,6 +38,7 @@ namespace ModernKeePass.Infrastructure.KeePass
.ForMember(dest => dest.AdditionalFields, opt => opt.MapFrom(src => .ForMember(dest => dest.AdditionalFields, opt => opt.MapFrom(src =>
src.Strings.Where(s => !PwDefs.GetStandardFields().Contains(s.Key)).ToDictionary(s => s.Key, s => GetEntryValue(src, s.Key)))) src.Strings.Where(s => !PwDefs.GetStandardFields().Contains(s.Key)).ToDictionary(s => s.Key, s => GetEntryValue(src, s.Key))))
.ForMember(dest => dest.LastModificationDate, opt => opt.MapFrom(src => new DateTimeOffset(src.LastModificationTime))); .ForMember(dest => dest.LastModificationDate, opt => opt.MapFrom(src => new DateTimeOffset(src.LastModificationTime)));
//.MaxDepth(1);
} }
private void FromModelToDto() private void FromModelToDto()

View File

@@ -15,17 +15,18 @@ namespace ModernKeePass.Infrastructure.KeePass
private void FromDtoToModel() private void FromDtoToModel()
{ {
CreateMap<PwGroup, GroupEntity>() CreateMap<PwGroup, GroupEntity>()
//.ForMember(d => d.Parent, opts => opts.MapFrom(s => s.ParentGroup))
.ForMember(d => d.Id, opts => opts.MapFrom(s => s.Uuid.ToHexString())) .ForMember(d => d.Id, opts => opts.MapFrom(s => s.Uuid.ToHexString()))
.ForMember(d => d.Name, opts => opts.MapFrom(s => s.Name)) .ForMember(d => d.Name, opts => opts.MapFrom(s => s.Name))
.ForMember(d => d.Icon, opts => opts.MapFrom(s => IconMapper.MapPwIconToIcon(s.IconId))) .ForMember(d => d.Icon, opts => opts.MapFrom(s => IconMapper.MapPwIconToIcon(s.IconId)))
.ForMember(d => d.LastModificationDate, opts => opts.MapFrom(s => s.LastModificationTime)) .ForMember(d => d.LastModificationDate, opts => opts.MapFrom(s => s.LastModificationTime))
.ForMember(d => d.Entries, opts => opts.MapFrom(s => s.Entries)) .ForMember(d => d.Entries, opts => opts.MapFrom(s => s.Entries))
.ForMember(d => d.SubGroups, opts => opts.MapFrom(s => s.Groups)); .ForMember(d => d.SubGroups, opts => opts.MapFrom(s => s.Groups));
//.MaxDepth(1);
} }
private void FromModelToDto() private void FromModelToDto()
{ {
throw new System.NotImplementedException();
} }
} }
} }

View File

@@ -20,7 +20,6 @@ namespace ModernKeePass.Infrastructure.KeePass
{ {
public class KeePassDatabaseClient: IDatabaseProxy public class KeePassDatabaseClient: IDatabaseProxy
{ {
private readonly ISettingsProxy _settings;
private readonly IFileProxy _fileService; private readonly IFileProxy _fileService;
private readonly IMapper _mapper; private readonly IMapper _mapper;
private readonly IDateTime _dateTime; private readonly IDateTime _dateTime;
@@ -77,9 +76,8 @@ namespace ModernKeePass.Infrastructure.KeePass
set { _pwDatabase.Compression = (PwCompressionAlgorithm) Enum.Parse(typeof(PwCompressionAlgorithm), value); } set { _pwDatabase.Compression = (PwCompressionAlgorithm) Enum.Parse(typeof(PwCompressionAlgorithm), value); }
} }
public KeePassDatabaseClient(ISettingsProxy settings, IFileProxy fileService, IMapper mapper, IDateTime dateTime) public KeePassDatabaseClient(IFileProxy fileService, IMapper mapper, IDateTime dateTime)
{ {
_settings = settings;
_fileService = fileService; _fileService = fileService;
_mapper = mapper; _mapper = mapper;
_dateTime = dateTime; _dateTime = dateTime;
@@ -111,17 +109,16 @@ namespace ModernKeePass.Infrastructure.KeePass
return await Open(new FileInfo {Path = _fileAccessToken}, _credentials); return await Open(new FileInfo {Path = _fileAccessToken}, _credentials);
} }
public async Task<GroupEntity> Create(FileInfo fileInfo, Credentials credentials) public async Task<GroupEntity> Create(FileInfo fileInfo, Credentials credentials, DatabaseVersion version = DatabaseVersion.V2)
{ {
var compositeKey = await CreateCompositeKey(credentials); var compositeKey = await CreateCompositeKey(credentials);
var ioConnection = await BuildConnectionInfo(fileInfo); var ioConnection = await BuildConnectionInfo(fileInfo);
_pwDatabase.New(ioConnection, compositeKey); _pwDatabase.New(ioConnection, compositeKey);
var fileFormat = _settings.GetSetting<string>("DefaultFileFormat"); switch (version)
switch (fileFormat)
{ {
case "4": case DatabaseVersion.V4:
_pwDatabase.KdfParameters = KdfPool.Get("Argon2").GetDefaultParameters(); _pwDatabase.KdfParameters = KdfPool.Get("Argon2").GetDefaultParameters();
break; break;
} }

View File

@@ -1,10 +1,10 @@
{ {
"supports": {}, "supports": {},
"dependencies": { "dependencies": {
"AutoMapper": "6.1.1", "AutoMapper": "6.0.2",
"AutoMapper.Extensions.Microsoft.DependencyInjection": "2.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "2.0.1",
"Microsoft.NETCore.Portable.Compatibility": "1.0.1", "Microsoft.NETCore.Portable.Compatibility": "1.0.1",
"ModernKeePassLib": "2.44.1", "ModernKeePassLib": "2.44.2",
"NETStandard.Library": "2.0.3" "NETStandard.Library": "2.0.3"
}, },
"frameworks": { "frameworks": {

View File

@@ -17,8 +17,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AutoMapper" Version="9.0.0" /> <PackageReference Include="AutoMapper" Version="6.1.1" />
<PackageReference Include="ModernKeePassLib" Version="2.44.1" /> <PackageReference Include="ModernKeePassLib" Version="2.44.2" />
<PackageReference Include="NSubstitute" Version="4.2.1" /> <PackageReference Include="NSubstitute" Version="4.2.1" />
<PackageReference Include="nunit" Version="3.12.0" /> <PackageReference Include="nunit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1"> <PackageReference Include="NUnit3TestAdapter" Version="3.16.1">

View File

@@ -1,6 +1,8 @@
using System.Windows.Input; using System.Windows.Input;
using Windows.UI.Xaml; using Windows.UI.Xaml;
using MediatR;
using Microsoft.Xaml.Interactivity; using Microsoft.Xaml.Interactivity;
using ModernKeePass.Application.Database.Queries.GetDatabase;
using ModernKeePass.Common; using ModernKeePass.Common;
using ModernKeePass.Interfaces; using ModernKeePass.Interfaces;
using ModernKeePass.Services; using ModernKeePass.Services;
@@ -10,6 +12,8 @@ namespace ModernKeePass.Actions
{ {
public class DeleteEntityAction : DependencyObject, IAction public class DeleteEntityAction : DependencyObject, IAction
{ {
private readonly IMediator _mediator;
public IVmEntity Entity public IVmEntity Entity
{ {
get { return (IVmEntity)GetValue(EntityProperty); } get { return (IVmEntity)GetValue(EntityProperty); }
@@ -30,15 +34,23 @@ namespace ModernKeePass.Actions
DependencyProperty.Register("Command", typeof(ICommand), typeof(DeleteEntityAction), DependencyProperty.Register("Command", typeof(ICommand), typeof(DeleteEntityAction),
new PropertyMetadata(null)); new PropertyMetadata(null));
public DeleteEntityAction() : this(App.Mediator) { }
public DeleteEntityAction(IMediator mediator)
{
_mediator = mediator;
}
public object Execute(object sender, object parameter) public object Execute(object sender, object parameter)
{ {
var resource = new ResourcesService(); var resource = new ResourcesService();
var type = Entity is GroupVm ? "Group" : "Entry"; var type = Entity is GroupVm ? "Group" : "Entry";
var isRecycleOnDelete = _mediator.Send(new GetDatabaseQuery()).GetAwaiter().GetResult().IsRecycleBinEnabled;
var message = Entity.IsRecycleOnDelete var message = isRecycleOnDelete
? resource.GetResourceValue($"{type}RecyclingConfirmation") ? resource.GetResourceValue($"{type}RecyclingConfirmation")
: resource.GetResourceValue($"{type}DeletingConfirmation"); : resource.GetResourceValue($"{type}DeletingConfirmation");
var text = Entity.IsRecycleOnDelete ? resource.GetResourceValue($"{type}Recycled") : resource.GetResourceValue($"{type}Deleted"); var text = isRecycleOnDelete ? resource.GetResourceValue($"{type}Recycled") : resource.GetResourceValue($"{type}Deleted");
MessageDialogHelper.ShowActionDialog(resource.GetResourceValue("EntityDeleteTitle"), message, MessageDialogHelper.ShowActionDialog(resource.GetResourceValue("EntityDeleteTitle"), message,
resource.GetResourceValue("EntityDeleteActionButton"), resource.GetResourceValue("EntityDeleteActionButton"),
resource.GetResourceValue("EntityDeleteCancelButton"), a => resource.GetResourceValue("EntityDeleteCancelButton"), a =>

View File

@@ -19,7 +19,6 @@ using ModernKeePass.Application.Database.Commands.SaveDatabase;
using ModernKeePass.Application.Database.Queries.GetDatabase; using ModernKeePass.Application.Database.Queries.GetDatabase;
using ModernKeePass.Application.Database.Queries.ReOpenDatabase; using ModernKeePass.Application.Database.Queries.ReOpenDatabase;
using ModernKeePass.Common; using ModernKeePass.Common;
using ModernKeePass.Domain.Dtos;
using ModernKeePass.Domain.Exceptions; using ModernKeePass.Domain.Exceptions;
using ModernKeePass.Infrastructure; using ModernKeePass.Infrastructure;
using ModernKeePass.Services; using ModernKeePass.Services;
@@ -58,6 +57,7 @@ namespace ModernKeePass
IServiceCollection serviceCollection = new ServiceCollection(); IServiceCollection serviceCollection = new ServiceCollection();
serviceCollection.AddApplication(); serviceCollection.AddApplication();
serviceCollection.AddInfrastructure(); serviceCollection.AddInfrastructure();
serviceCollection.AddAppAutomapper();
Services = serviceCollection.BuildServiceProvider(); Services = serviceCollection.BuildServiceProvider();
Mediator = Services.GetService<IMediator>(); Mediator = Services.GetService<IMediator>();
} }
@@ -97,12 +97,7 @@ namespace ModernKeePass
if (file != null) if (file != null)
{ {
var token = StorageApplicationPermissions.FutureAccessList.Add(file); var token = StorageApplicationPermissions.FutureAccessList.Add(file);
var fileInfo = new FileInfo await Mediator.Send(new SaveDatabaseCommand { FilePath = token });
{
Name = file.DisplayName,
Path = token
};
await Mediator.Send(new SaveDatabaseCommand { FileInfo = fileInfo });
} }
}, null); }, null);
} }

View File

@@ -1,6 +1,6 @@
using Windows.UI.Xaml; using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls;
using ModernKeePass.Interfaces; using ModernKeePass.Domain.Interfaces;
namespace ModernKeePass.Controls namespace ModernKeePass.Controls
{ {

View File

@@ -5,11 +5,11 @@ using ModernKeePass.Domain.Enums;
namespace ModernKeePass.Converters namespace ModernKeePass.Converters
{ {
public class IntToSymbolConverter : IValueConverter public class IconToSymbolConverter : IValueConverter
{ {
public object Convert(object value, Type targetType, object parameter, string language) public object Convert(object value, Type targetType, object parameter, string language)
{ {
var icon = (Icon) value; var icon = (Icon)value;
switch (icon) switch (icon)
{ {
case Icon.Delete: return Symbol.Delete; case Icon.Delete: return Symbol.Delete;
@@ -67,7 +67,7 @@ namespace ModernKeePass.Converters
public object ConvertBack(object value, Type targetType, object parameter, string language) public object ConvertBack(object value, Type targetType, object parameter, string language)
{ {
var symbol = (Symbol) value; var symbol = (Symbol)value;
var defaultIcon = parameter != null ? int.Parse(parameter as string) : -1; var defaultIcon = parameter != null ? int.Parse(parameter as string) : -1;
switch (symbol) switch (symbol)
{ {

View File

@@ -0,0 +1,18 @@
using System.Reflection;
using AutoMapper;
using Microsoft.Extensions.DependencyInjection;
namespace ModernKeePass
{
public static class DependencyInjection
{
public static IServiceCollection AddAppAutomapper(this IServiceCollection services)
{
var applicationAssembly = typeof(Application.DependencyInjection).GetTypeInfo().Assembly;
var infrastructureAssembly = typeof(Infrastructure.DependencyInjection).GetTypeInfo().Assembly;
services.AddAutoMapper(applicationAssembly, infrastructureAssembly);
return services;
}
}
}

View File

@@ -1,5 +1,5 @@
using System; using System;
using ModernKeePass.ViewModels; using ModernKeePass.Application.Group.Models;
namespace ModernKeePass.Events namespace ModernKeePass.Events
{ {

View File

@@ -1,20 +1,18 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
using ModernKeePass.ViewModels; using Windows.UI.Xaml.Controls;
using ModernKeePass.Application.Group.Models;
namespace ModernKeePass.Interfaces namespace ModernKeePass.Interfaces
{ {
public interface IVmEntity public interface IVmEntity
{ {
GroupVm ParentGroup { get; } Symbol Icon { get; }
GroupVm PreviousGroup { get; }
int Icon { get; }
string Id { get; } string Id { get; }
string Title { get; set; } string Title { get; set; }
IEnumerable<IVmEntity> BreadCrumb { get; } IEnumerable<GroupVm> BreadCrumb { get; }
bool IsEditMode { get; } bool IsEditMode { get; }
bool IsRecycleOnDelete { get; }
/// <summary> /// <summary>
/// Save changes to Model /// Save changes to Model

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest"> <Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
<Identity Name="wismna.ModernKeePass" Publisher="CN=0719A91A-C322-4EE0-A257-E60733EECF06" Version="1.15.0.0" /> <Identity Name="wismna.ModernKeePass" Publisher="CN=0719A91A-C322-4EE0-A257-E60733EECF06" Version="1.15.0.2" />
<Properties> <Properties>
<DisplayName>ModernKeePass</DisplayName> <DisplayName>ModernKeePass</DisplayName>
<PublisherDisplayName>wismna</PublisherDisplayName> <PublisherDisplayName>wismna</PublisherDisplayName>

View File

@@ -1,6 +1,6 @@
using Windows.UI.Xaml; using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls;
using ModernKeePass.Interfaces; using ModernKeePass.Domain.Interfaces;
namespace ModernKeePass.TemplateSelectors namespace ModernKeePass.TemplateSelectors
{ {

View File

@@ -3,13 +3,16 @@ using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
using Windows.UI.Xaml.Controls;
using MediatR; using MediatR;
using ModernKeePass.Application.Database.Commands.SaveDatabase; using ModernKeePass.Application.Database.Commands.SaveDatabase;
using ModernKeePass.Application.Database.Models; using ModernKeePass.Application.Database.Models;
using ModernKeePass.Application.Database.Queries.GetDatabase; using ModernKeePass.Application.Database.Queries.GetDatabase;
using ModernKeePass.Application.Entry.Commands.SetFieldValue; using ModernKeePass.Application.Entry.Commands.SetFieldValue;
using ModernKeePass.Application.Group.Commands.AddEntry;
using ModernKeePass.Application.Group.Commands.CreateGroup; using ModernKeePass.Application.Group.Commands.CreateGroup;
using ModernKeePass.Application.Group.Commands.DeleteEntry; using ModernKeePass.Application.Group.Commands.DeleteEntry;
using ModernKeePass.Application.Group.Commands.RemoveEntry;
using ModernKeePass.Application.Security.Commands.GeneratePassword; using ModernKeePass.Application.Security.Commands.GeneratePassword;
using ModernKeePass.Application.Security.Queries.EstimatePasswordComplexity; using ModernKeePass.Application.Security.Queries.EstimatePasswordComplexity;
using ModernKeePass.Common; using ModernKeePass.Common;
@@ -34,8 +37,23 @@ namespace ModernKeePass.ViewModels
public bool BracketsPatternSelected { get; set; } public bool BracketsPatternSelected { get; set; }
public string CustomChars { get; set; } = string.Empty; public string CustomChars { get; set; } = string.Empty;
public string Id => _entry.Id; public string Id => _entry.Id;
public bool IsRecycleOnDelete => _database.IsRecycleBinEnabled && !ParentGroup.IsSelected;
public IEnumerable<IVmEntity> BreadCrumb => new List<IVmEntity>(ParentGroup.BreadCrumb) {ParentGroup}; public IEnumerable<Application.Group.Models.GroupVm> BreadCrumb
{
get
{
var groups = new Stack<Application.Group.Models.GroupVm>();
var group = _entry.ParentGroup;
while (group.ParentGroup != null)
{
group = group.ParentGroup;
groups.Push(group);
}
return groups;
}
}
/// <summary> /// <summary>
/// Determines if the Entry is current or from history /// Determines if the Entry is current or from history
/// </summary> /// </summary>
@@ -87,12 +105,12 @@ namespace ModernKeePass.ViewModels
set { _mediator.Send(new SetFieldValueCommand { EntryId = Id, FieldName = nameof(Notes), FieldValue = value }); } set { _mediator.Send(new SetFieldValueCommand { EntryId = Id, FieldName = nameof(Notes), FieldValue = value }); }
} }
public int Icon public Symbol Icon
{ {
get get
{ {
if (HasExpired) return (int)Domain.Enums.Icon.ReportHacked; if (HasExpired) return Symbol.ReportHacked;
return (int) _entry.Icon; return (Symbol) _entry.Icon;
} }
set { _mediator.Send(new SetFieldValueCommand { EntryId = Id, FieldName = nameof(Icon), FieldValue = value }); } set { _mediator.Send(new SetFieldValueCommand { EntryId = Id, FieldName = nameof(Icon), FieldValue = value }); }
} }
@@ -156,20 +174,7 @@ namespace ModernKeePass.ViewModels
} }
} }
public IEnumerable<IVmEntity> History public IEnumerable<Application.Entry.Models.EntryVm> History => _entry.History;
{
get
{
var history = new Stack<EntryVm>();
foreach (var historyEntry in _entry.History)
{
history.Push(new EntryVm(historyEntry, ParentGroup) {IsSelected = false});
}
history.Push(this);
return history;
}
}
public Color? BackgroundColor public Color? BackgroundColor
@@ -190,6 +195,8 @@ namespace ModernKeePass.ViewModels
} }
} }
public bool CanRestore => _entry.ParentGroup == _database.RecycleBin;
public ICommand SaveCommand { get; } public ICommand SaveCommand { get; }
public ICommand GeneratePasswordCommand { get; } public ICommand GeneratePasswordCommand { get; }
public ICommand UndoDeleteCommand { get; } public ICommand UndoDeleteCommand { get; }
@@ -197,7 +204,7 @@ namespace ModernKeePass.ViewModels
private readonly Application.Entry.Models.EntryVm _entry; private readonly Application.Entry.Models.EntryVm _entry;
private readonly IMediator _mediator; private readonly IMediator _mediator;
private readonly IResourceService _resource; private readonly IResourceService _resource;
private DatabaseVm _database; private readonly DatabaseVm _database;
private bool _isEditMode; private bool _isEditMode;
private bool _isRevealPassword; private bool _isRevealPassword;
private double _passwordLength = 25; private double _passwordLength = 25;
@@ -205,18 +212,20 @@ namespace ModernKeePass.ViewModels
public EntryVm() { } public EntryVm() { }
internal EntryVm(Application.Entry.Models.EntryVm entry, Application.Group.Models.GroupVm parent) : this(entry, parent, App.Mediator, new ResourcesService()) { } internal EntryVm(Application.Entry.Models.EntryVm entry, bool isNewEntry = false) : this(entry, App.Mediator, new ResourcesService(), isNewEntry) { }
public EntryVm(Application.Entry.Models.EntryVm entry, Application.Group.Models.GroupVm parent, IMediator mediator, IResourceService resource) public EntryVm(Application.Entry.Models.EntryVm entry, IMediator mediator, IResourceService resource, bool isNewEntry = false)
{ {
_entry = entry; _entry = entry;
_mediator = mediator; _mediator = mediator;
_resource = resource; _resource = resource;
_database = _mediator.Send(new GetDatabaseQuery()).GetAwaiter().GetResult(); _database = _mediator.Send(new GetDatabaseQuery()).GetAwaiter().GetResult();
_isEditMode = isNewEntry;
if (isNewEntry) GeneratePassword().GetAwaiter().GetResult();
SaveCommand = new RelayCommand(() => _mediator.Send(new SaveDatabaseCommand())); SaveCommand = new RelayCommand(() => _mediator.Send(new SaveDatabaseCommand()));
GeneratePasswordCommand = new RelayCommand(async () => await GeneratePassword()); GeneratePasswordCommand = new RelayCommand(async () => await GeneratePassword());
UndoDeleteCommand = new RelayCommand(async () => await Move(PreviousGroup), () => PreviousGroup != null); UndoDeleteCommand = new RelayCommand(async () => await Move(entry.ParentGroup), () => _entry.ParentGroup != null);
} }
public async Task GeneratePassword() public async Task GeneratePassword()
@@ -242,20 +251,18 @@ namespace ModernKeePass.ViewModels
{ {
if (_database.IsRecycleBinEnabled && _database.RecycleBin == null) if (_database.IsRecycleBinEnabled && _database.RecycleBin == null)
await _mediator.Send(new CreateGroupCommand { ParentGroup = _database.RootGroup, IsRecycleBin = true, Name = recycleBinTitle}); await _mediator.Send(new CreateGroupCommand { ParentGroup = _database.RootGroup, IsRecycleBin = true, Name = recycleBinTitle});
await Move(_database.IsRecycleBinEnabled && !ParentGroup.IsSelected ? _database.RecycleBin : null); await Move(_database.IsRecycleBinEnabled && _entry.ParentGroup == _database.RecycleBin ? _database.RecycleBin : null);
} }
public async Task Move(Application.Group.Models.GroupVm destination) public async Task Move(Application.Group.Models.GroupVm destination)
{ {
PreviousGroup = ParentGroup; await _mediator.Send(new RemoveEntryCommand { ParentGroup = _entry.ParentGroup, Entry = _entry });
PreviousGroup.Entries.Remove(this);
if (destination == null) if (destination == null)
{ {
await _mediator.Send(new DeleteEntryCommand { Entry = _entry }); await _mediator.Send(new DeleteEntryCommand { Entry = _entry });
return; return;
} }
ParentGroup = destination; await _mediator.Send(new AddEntryCommand { ParentGroup = destination, Entry = _entry });
ParentGroup.Entries.Add(this);
} }
public async Task CommitDelete() public async Task CommitDelete()

View File

@@ -4,6 +4,7 @@ using System.Collections.Specialized;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
using Windows.UI.Xaml.Controls;
using MediatR; using MediatR;
using ModernKeePass.Application.Database.Commands.SaveDatabase; using ModernKeePass.Application.Database.Commands.SaveDatabase;
using ModernKeePass.Application.Database.Models; using ModernKeePass.Application.Database.Models;
@@ -27,38 +28,29 @@ namespace ModernKeePass.ViewModels
{ {
public class GroupVm : NotifyPropertyChangedBase, IVmEntity, ISelectableModel public class GroupVm : NotifyPropertyChangedBase, IVmEntity, ISelectableModel
{ {
public GroupVm ParentGroup { get; private set; } public ObservableCollection<Application.Entry.Models.EntryVm> Entries => new ObservableCollection<Application.Entry.Models.EntryVm>(_group.Entries);
public GroupVm PreviousGroup { get; private set; }
public ObservableCollection<EntryVm> Entries public ObservableCollection<Application.Group.Models.GroupVm> Groups => new ObservableCollection<Application.Group.Models.GroupVm>(_group.SubGroups);
{
get { return _entries; }
private set { SetProperty(ref _entries, value); }
}
public IEnumerable<EntryVm> SubEntries public IEnumerable<Application.Entry.Models.EntryVm> SubEntries
{ {
get get
{ {
var subEntries = new List<EntryVm>(); var subEntries = new List<Application.Entry.Models.EntryVm>();
subEntries.AddRange(Entries); subEntries.AddRange(Entries);
foreach (var group in Groups) foreach (var group in Groups)
{ {
subEntries.AddRange(group.SubEntries); subEntries.AddRange(group.Entries);
} }
return subEntries; return subEntries;
} }
} }
public ObservableCollection<GroupVm> Groups { get; set; } = new ObservableCollection<GroupVm>();
public string Id => _group.Id; public bool IsNotRoot => _database.RootGroup != _group;
public bool IsNotRoot => ParentGroup != null;
public bool ShowRestore => IsNotRoot && ParentGroup.IsSelected; public bool ShowRestore => IsNotRoot && _database.RecycleBin != _group;
public bool IsRecycleOnDelete => GetDatabase().IsRecycleBinEnabled && !IsSelected && !ParentGroup.IsSelected;
/// <summary> /// <summary>
/// Is the Group the database Recycle Bin? /// Is the Group the database Recycle Bin?
@@ -67,33 +59,30 @@ namespace ModernKeePass.ViewModels
{ {
get get
{ {
var database = GetDatabase(); return _database.IsRecycleBinEnabled && _database.RecycleBin == _group;
return database.IsRecycleBinEnabled && database.RecycleBinId == Id;
} }
set set
{ {
if (value && _group != null) _database.RecycleBin = this; if (value && _group != null) _database.RecycleBin = _group;
} }
} }
public IOrderedEnumerable<IGrouping<char, EntryVm>> EntriesZoomedOut => from e in Entries public IOrderedEnumerable<IGrouping<char, Application.Entry.Models.EntryVm>> EntriesZoomedOut => from e in Entries
group e by e.Title.ToUpper().FirstOrDefault() into grp group e by e.Title.ToUpper().FirstOrDefault() into grp
orderby grp.Key orderby grp.Key
select grp; select grp;
public string Id => _group.Id;
public string Title public string Title
{ {
get { return _group == null ? string.Empty : _group.Title; } get { return _group.Title; }
set { _group.Title = value; } set { _group.Title = value; }
} }
public int Icon public Symbol Icon
{ {
get get { return (Symbol) _group.Icon; }
{
if (_group?.Icon != null) return (int) _group?.Icon;
return -1;
}
set { _group.Icon = (Icon)value; } set { _group.Icon = (Icon)value; }
} }
@@ -114,12 +103,12 @@ namespace ModernKeePass.ViewModels
set { SetProperty(ref _isMenuClosed, value); } set { SetProperty(ref _isMenuClosed, value); }
} }
public IEnumerable<IVmEntity> BreadCrumb public IEnumerable<Application.Group.Models.GroupVm> BreadCrumb
{ {
get get
{ {
var groups = new Stack<GroupVm>(); var groups = new Stack<Application.Group.Models.GroupVm>();
var group = this; var group = _group;
while (group.ParentGroup != null) while (group.ParentGroup != null)
{ {
group = group.ParentGroup; group = group.ParentGroup;
@@ -137,33 +126,31 @@ namespace ModernKeePass.ViewModels
private readonly Application.Group.Models.GroupVm _group; private readonly Application.Group.Models.GroupVm _group;
private readonly IMediator _mediator; private readonly IMediator _mediator;
private readonly DatabaseVm _database;
private bool _isEditMode; private bool _isEditMode;
private Application.Entry.Models.EntryVm _reorderedEntry; private Application.Entry.Models.EntryVm _reorderedEntry;
private ObservableCollection<EntryVm> _entries = new ObservableCollection<EntryVm>();
private bool _isMenuClosed = true; private bool _isMenuClosed = true;
public GroupVm() {} public GroupVm() {}
internal GroupVm(Application.Group.Models.GroupVm group, GroupVm parent, string recycleBinId = null) : this(group, parent, App.Mediator, recycleBinId) internal GroupVm(Application.Group.Models.GroupVm group) : this(group, App.Mediator)
{ } { }
public GroupVm(Application.Group.Models.GroupVm group, GroupVm parent, IMediator mediator, string recycleBinId = null) public GroupVm(Application.Group.Models.GroupVm group, IMediator mediator, bool isEditMode = false)
{ {
_group = group; _group = group;
_mediator = mediator; _mediator = mediator;
ParentGroup = parent; _database = _mediator.Send(new GetDatabaseQuery()).GetAwaiter().GetResult();
_isEditMode = isEditMode;
SaveCommand = new RelayCommand(async () => await _mediator.Send(new SaveDatabaseCommand())); SaveCommand = new RelayCommand(async () => await _mediator.Send(new SaveDatabaseCommand()));
SortEntriesCommand = new RelayCommand(async () => SortEntriesCommand = new RelayCommand(async () =>
await SortEntriesAsync().ConfigureAwait(false), () => IsEditMode); await SortEntriesAsync().ConfigureAwait(false), () => IsEditMode);
SortGroupsCommand = new RelayCommand(async () => SortGroupsCommand = new RelayCommand(async () =>
await SortGroupsAsync().ConfigureAwait(false), () => IsEditMode); await SortGroupsAsync().ConfigureAwait(false), () => IsEditMode);
UndoDeleteCommand = new RelayCommand(async () => await Move(PreviousGroup), () => PreviousGroup != null); UndoDeleteCommand = new RelayCommand(async () => await Move(group.ParentGroup), () => _group.ParentGroup != null);
if (recycleBinId != null && _group.Id.Equals(recycleBinId)) _database.RecycleBin = this;
Entries = new ObservableCollection<EntryVm>(group.Entries.Select(e => new EntryVm(e, this)));
Entries.CollectionChanged += Entries_CollectionChanged; Entries.CollectionChanged += Entries_CollectionChanged;
Groups = new ObservableCollection<GroupVm>(group.SubGroups.Select(g => new GroupVm(g, this, recycleBinId)));
} }
private async void Entries_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) private async void Entries_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
@@ -189,50 +176,33 @@ namespace ModernKeePass.ViewModels
} }
} }
public async Task<GroupVm> AddNewGroup(string name = "") public async Task<Application.Group.Models.GroupVm> AddNewGroup(string name = "")
{ {
var newGroup = await _mediator.Send(new CreateGroupCommand {Name = name, ParentGroup = _group}); return await _mediator.Send(new CreateGroupCommand {Name = name, ParentGroup = _group});
var newGroupVm = new GroupVm(newGroup, this) {Title = name, IsEditMode = string.IsNullOrEmpty(name)};
Groups.Add(newGroupVm);
return newGroupVm;
} }
public async Task<EntryVm> AddNewEntry() public async Task<Application.Entry.Models.EntryVm> AddNewEntry()
{ {
var newEntry = await _mediator.Send(new CreateEntryCommand { ParentGroup = _group }); return await _mediator.Send(new CreateEntryCommand { ParentGroup = _group });
var newEntryVm = new EntryVm(newEntry, this) {IsEditMode = true};
await newEntryVm.GeneratePassword();
Entries.Add(newEntryVm);
return newEntryVm;
} }
public async Task MarkForDelete(string recycleBinTitle) public async Task MarkForDelete(string recycleBinTitle)
{ {
var database = GetDatabase(); if (_database.IsRecycleBinEnabled && _database.RecycleBin == null)
if (database.IsRecycleBinEnabled && database.RecycleBinId == null) await _mediator.Send(new CreateGroupCommand {ParentGroup = _database.RootGroup, IsRecycleBin = true, Name = recycleBinTitle});
await _mediator.Send(new CreateGroupCommand {ParentGroup = database.RootGroup, IsRecycleBin = true, Name = recycleBinTitle}); await Move(_database.IsRecycleBinEnabled && !IsSelected ? _database.RecycleBin : null);
await Move(database.IsRecycleBinEnabled && !IsSelected ? _database.RecycleBin : null);
((RelayCommand)UndoDeleteCommand).RaiseCanExecuteChanged(); ((RelayCommand)UndoDeleteCommand).RaiseCanExecuteChanged();
} }
public async Task UndoDelete()
{
await Move(PreviousGroup);
}
public async Task Move(GroupVm destination) public async Task Move(Application.Group.Models.GroupVm destination)
{ {
PreviousGroup = ParentGroup; await _mediator.Send(new RemoveGroupCommand {ParentGroup = _group.ParentGroup, Group = _group});
PreviousGroup.Groups.Remove(this);
await _mediator.Send(new RemoveGroupCommand {ParentGroup = PreviousGroup._group, Group = _group});
if (destination == null) if (destination == null)
{ {
await _mediator.Send(new DeleteGroupCommand { Group = _group }); await _mediator.Send(new DeleteGroupCommand { Group = _group });
return; return;
} }
ParentGroup = destination; await _mediator.Send(new AddGroupCommand {ParentGroup = destination, Group = _group});
ParentGroup.Groups.Add(this);
await _mediator.Send(new AddGroupCommand {ParentGroup = ParentGroup._group, Group = _group});
} }
public async Task CommitDelete() public async Task CommitDelete()
@@ -248,20 +218,13 @@ namespace ModernKeePass.ViewModels
private async Task SortEntriesAsync() private async Task SortEntriesAsync()
{ {
await _mediator.Send(new SortEntriesCommand {Group = _group}); await _mediator.Send(new SortEntriesCommand {Group = _group});
Entries = new ObservableCollection<EntryVm>(Entries.OrderBy(e => e.Title)); OnPropertyChanged(nameof(Entries));
} }
private async Task SortGroupsAsync() private async Task SortGroupsAsync()
{ {
await _mediator.Send(new SortGroupsCommand {Group = _group}); await _mediator.Send(new SortGroupsCommand {Group = _group});
Groups = new ObservableCollection<GroupVm>(Groups.OrderBy(g => g.Title).ThenBy(g => g._group == null));
// TODO: should not be needed
OnPropertyChanged(nameof(Groups)); OnPropertyChanged(nameof(Groups));
} }
private DatabaseVm GetDatabase()
{
return _mediator.Send(new GetDatabaseQuery()).GetAwaiter().GetResult();
}
} }
} }

View File

@@ -1,6 +1,7 @@
using System; using System;
using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls;
using ModernKeePass.Common; using ModernKeePass.Common;
using ModernKeePass.Domain.Interfaces;
using ModernKeePass.Interfaces; using ModernKeePass.Interfaces;
namespace ModernKeePass.ViewModels namespace ModernKeePass.ViewModels

View File

@@ -1,6 +1,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Windows.Storage; using Windows.Storage;
using ModernKeePass.Common; using ModernKeePass.Common;
using ModernKeePass.Domain.Interfaces;
using ModernKeePass.Interfaces; using ModernKeePass.Interfaces;
using ModernKeePass.Services; using ModernKeePass.Services;

View File

@@ -2,10 +2,6 @@
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using MediatR; using MediatR;
using ModernKeePass.Application.Cryptography.Models;
using ModernKeePass.Application.Cryptography.Queries.GetCiphers;
using ModernKeePass.Application.Cryptography.Queries.GetCompressions;
using ModernKeePass.Application.Cryptography.Queries.GetKeyDerivations;
using ModernKeePass.Application.Database.Models; using ModernKeePass.Application.Database.Models;
using ModernKeePass.Application.Database.Queries.GetDatabase; using ModernKeePass.Application.Database.Queries.GetDatabase;
using ModernKeePass.Application.Parameters.Commands.SetCipher; using ModernKeePass.Application.Parameters.Commands.SetCipher;
@@ -13,8 +9,12 @@ using ModernKeePass.Application.Parameters.Commands.SetCompression;
using ModernKeePass.Application.Parameters.Commands.SetHasRecycleBin; using ModernKeePass.Application.Parameters.Commands.SetHasRecycleBin;
using ModernKeePass.Application.Parameters.Commands.SetKeyDerivation; using ModernKeePass.Application.Parameters.Commands.SetKeyDerivation;
using ModernKeePass.Application.Parameters.Commands.SetRecycleBin; using ModernKeePass.Application.Parameters.Commands.SetRecycleBin;
using ModernKeePass.Application.Parameters.Models;
using ModernKeePass.Application.Parameters.Queries.GetCiphers;
using ModernKeePass.Application.Parameters.Queries.GetCompressions;
using ModernKeePass.Application.Parameters.Queries.GetKeyDerivations;
using ModernKeePass.Common; using ModernKeePass.Common;
using ModernKeePass.Interfaces; using ModernKeePass.Domain.Interfaces;
namespace ModernKeePass.ViewModels namespace ModernKeePass.ViewModels
{ {
@@ -37,14 +37,14 @@ namespace ModernKeePass.ViewModels
public bool IsNewRecycleBin public bool IsNewRecycleBin
{ {
get { return _database.RecycleBinId == null; } get { return _database.RecycleBin == null; }
set set
{ {
if (value) _mediator.Send(new SetRecycleBinCommand() { RecycleBinId = null }).GetAwaiter().GetResult(); if (value) _mediator.Send(new SetRecycleBinCommand { RecycleBin = null }).GetAwaiter().GetResult();
} }
} }
public ObservableCollection<GroupVm> Groups { get; set; } public ObservableCollection<Application.Group.Models.GroupVm> Groups { get; set; }
public IEnumerable<CipherVm> Ciphers => _mediator.Send(new GetCiphersQuery()).GetAwaiter().GetResult(); public IEnumerable<CipherVm> Ciphers => _mediator.Send(new GetCiphersQuery()).GetAwaiter().GetResult();
public IEnumerable<string> Compressions => _mediator.Send(new GetCompressionsQuery()).GetAwaiter().GetResult(); public IEnumerable<string> Compressions => _mediator.Send(new GetCompressionsQuery()).GetAwaiter().GetResult();
@@ -119,7 +119,7 @@ namespace ModernKeePass.ViewModels
{ {
_mediator = mediator; _mediator = mediator;
_database = _mediator.Send(new GetDatabaseQuery()).GetAwaiter().GetResult(); _database = _mediator.Send(new GetDatabaseQuery()).GetAwaiter().GetResult();
//Groups = _database.RootGroup.SubGroups; Groups = new ObservableCollection<Application.Group.Models.GroupVm>(_database.RootGroup.SubGroups);
} }
} }
} }

View File

@@ -6,6 +6,7 @@ using Windows.UI.Xaml.Controls;
using MediatR; using MediatR;
using ModernKeePass.Application.Database.Queries.GetDatabase; using ModernKeePass.Application.Database.Queries.GetDatabase;
using ModernKeePass.Common; using ModernKeePass.Common;
using ModernKeePass.Domain.Interfaces;
using ModernKeePass.Interfaces; using ModernKeePass.Interfaces;
using ModernKeePass.Services; using ModernKeePass.Services;
using ModernKeePass.Views; using ModernKeePass.Views;

View File

@@ -1,21 +1,20 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Windows.Storage; using Windows.Storage;
using Windows.UI.Xaml.Controls;
using MediatR; using MediatR;
using ModernKeePass.Application.Database.Queries.GetDatabase; using ModernKeePass.Application.Database.Queries.GetDatabase;
using ModernKeePass.Application.Entry.Commands.SetFieldValue; using ModernKeePass.Application.Entry.Commands.SetFieldValue;
using ModernKeePass.Application.Group.Commands.CreateEntry; using ModernKeePass.Application.Group.Commands.CreateEntry;
using ModernKeePass.Application.Group.Commands.CreateGroup; using ModernKeePass.Application.Group.Commands.CreateGroup;
using ModernKeePass.Converters;
using ModernKeePass.Domain.Enums; using ModernKeePass.Domain.Enums;
using ModernKeePass.ImportFormats;
using ModernKeePass.Interfaces; using ModernKeePass.Interfaces;
using ModernKeePass.Services;
namespace ModernKeePass.ViewModels namespace ModernKeePass.ViewModels
{ {
public class NewVm : OpenVm public class NewVm : OpenVm
{ {
private readonly IMediator _mediator; private readonly IMediator _mediator;
private readonly ISettingsService _settings;
private string _importFormatHelp; private string _importFormatHelp;
public string Password { get; set; } public string Password { get; set; }
@@ -37,18 +36,19 @@ namespace ModernKeePass.ViewModels
} }
} }
public NewVm(): this(App.Mediator) { } public NewVm(): this(App.Mediator, new SettingsService()) { }
public NewVm(IMediator mediator) public NewVm(IMediator mediator, ISettingsService settings)
{ {
_mediator = mediator; _mediator = mediator;
_settings = settings;
} }
public async Task PopulateInitialData(ISettingsService settings, IImportService<IFormat> importService) public async Task<Application.Group.Models.GroupVm> PopulateInitialData()
{ {
var database = await _mediator.Send(new GetDatabaseQuery()); var database = await _mediator.Send(new GetDatabaseQuery());
if (settings.GetSetting<bool>("Sample") && !IsImportChecked) await CreateSampleData(database.RootGroup); if (_settings.GetSetting<bool>("Sample") && !IsImportChecked) await CreateSampleData(database.RootGroup);
else if (IsImportChecked && ImportFile != null && ! (ImportFormat is NullImportFormat)) importService.Import(ImportFormat, ImportFile, database.RootGroup); return database.RootGroup;
} }
private async Task CreateSampleData(Application.Group.Models.GroupVm group) private async Task CreateSampleData(Application.Group.Models.GroupVm group)

View File

@@ -7,29 +7,32 @@ namespace ModernKeePass.ViewModels
{ {
public class OpenVm: NotifyPropertyChangedBase public class OpenVm: NotifyPropertyChangedBase
{ {
private readonly IRecentService _recent;
public bool IsFileSelected => DatabaseFile != null; public bool IsFileSelected => DatabaseFile != null;
public string Name => DatabaseFile?.DisplayName; public string Name => DatabaseFile?.DisplayName;
public StorageFile DatabaseFile { get; private set; } public StorageFile DatabaseFile { get; private set; }
internal void OpenFile(StorageFile file)
{
OpenFile(file, RecentService.Instance);
}
public void OpenFile(StorageFile file, IRecentService recent) public OpenVm(): this(new RecentService()) { }
public OpenVm(IRecentService recent)
{
_recent = recent;
}
public void OpenFile(StorageFile file)
{ {
DatabaseFile = file; DatabaseFile = file;
OnPropertyChanged("Name"); OnPropertyChanged("Name");
OnPropertyChanged("IsFileSelected"); OnPropertyChanged("IsFileSelected");
OnPropertyChanged("DatabaseFile"); OnPropertyChanged("DatabaseFile");
AddToRecentList(file, recent); AddToRecentList(file);
} }
private void AddToRecentList(StorageFile file, IRecentService recent) private void AddToRecentList(StorageFile file)
{ {
recent.Add(file, file.DisplayName); _recent.Add(file, file.DisplayName);
} }
} }
} }

View File

@@ -1,6 +1,7 @@
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Windows.Input; using System.Windows.Input;
using ModernKeePass.Common; using ModernKeePass.Common;
using ModernKeePass.Domain.Interfaces;
using ModernKeePass.Interfaces; using ModernKeePass.Interfaces;
using ModernKeePass.Services; using ModernKeePass.Services;

View File

@@ -4,6 +4,7 @@ using Windows.UI.Xaml.Controls;
using MediatR; using MediatR;
using ModernKeePass.Application.Database.Queries.GetDatabase; using ModernKeePass.Application.Database.Queries.GetDatabase;
using ModernKeePass.Common; using ModernKeePass.Common;
using ModernKeePass.Domain.Interfaces;
using ModernKeePass.Interfaces; using ModernKeePass.Interfaces;
using ModernKeePass.Views; using ModernKeePass.Views;
using ModernKeePass.Services; using ModernKeePass.Services;

View File

@@ -4,6 +4,7 @@ using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Navigation; using Windows.UI.Xaml.Navigation;
using ModernKeePass.Common; using ModernKeePass.Common;
using ModernKeePass.Domain.Interfaces;
using ModernKeePass.Interfaces; using ModernKeePass.Interfaces;
namespace ModernKeePass.Views.BasePages namespace ModernKeePass.Views.BasePages

View File

@@ -18,9 +18,8 @@
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<converters:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter" /> <converters:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter" />
<converters:ProgressBarLegalValuesConverter x:Key="ProgressBarLegalValuesConverter" /> <converters:ProgressBarLegalValuesConverter x:Key="ProgressBarLegalValuesConverter" />
<converters:DoubleToSolidColorBrushConverter x:Key="DoubleToForegroungBrushComplexityConverter" /> <converters:DoubleToSolidColorBrushConverter x:Key="DoubleToForegroundBrushComplexityConverter" />
<converters:ColorToBrushConverter x:Key="ColorToBrushConverter" /> <converters:ColorToBrushConverter x:Key="ColorToBrushConverter" />
<converters:IntToSymbolConverter x:Key="IntToSymbolConverter" />
<Style TargetType="PasswordBox" x:Name="PasswordBoxWithButtonStyle"> <Style TargetType="PasswordBox" x:Name="PasswordBoxWithButtonStyle">
<Setter Property="MinWidth" Value="{ThemeResource TextControlThemeMinWidth}" /> <Setter Property="MinWidth" Value="{ThemeResource TextControlThemeMinWidth}" />
<Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}" /> <Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}" />
@@ -429,7 +428,7 @@
</core:EventTriggerBehavior> </core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors> </interactivity:Interaction.Behaviors>
</local:TextBoxWithButton> </local:TextBoxWithButton>
<ProgressBar Value="{Binding PasswordComplexityIndicator, ConverterParameter=0\,128, Converter={StaticResource ProgressBarLegalValuesConverter}}" Maximum="128" Width="350" HorizontalAlignment="Left" Foreground="{Binding PasswordComplexityIndicator, ConverterParameter=128, Converter={StaticResource DoubleToForegroungBrushComplexityConverter}}" /> <ProgressBar Value="{Binding PasswordComplexityIndicator, ConverterParameter=0\,128, Converter={StaticResource ProgressBarLegalValuesConverter}}" Maximum="128" Width="350" HorizontalAlignment="Left" Foreground="{Binding PasswordComplexityIndicator, ConverterParameter=128, Converter={StaticResource DoubleToForegroundBrushComplexityConverter}}" />
<CheckBox x:Uid="EntryShowPassword" HorizontalAlignment="Left" Margin="-3,0,0,0" IsChecked="{Binding IsRevealPassword, Mode=TwoWay}" IsEnabled="{Binding IsRevealPasswordEnabled}" /> <CheckBox x:Uid="EntryShowPassword" HorizontalAlignment="Left" Margin="-3,0,0,0" IsChecked="{Binding IsRevealPassword, Mode=TwoWay}" IsEnabled="{Binding IsRevealPasswordEnabled}" />
<TextBlock TextWrapping="Wrap" Text="URL" FontSize="18"/> <TextBlock TextWrapping="Wrap" Text="URL" FontSize="18"/>
<local:TextBoxWithButton x:Uid="UrlTextBox" Text="{Binding Url, Mode=TwoWay}" MaxLength="256" Style="{StaticResource EntryTextBoxWithButtonStyle}" ButtonSymbol="&#xE111;" IsEnabled="{Binding IsSelected}"> <local:TextBoxWithButton x:Uid="UrlTextBox" Text="{Binding Url, Mode=TwoWay}" MaxLength="256" Style="{StaticResource EntryTextBoxWithButtonStyle}" ButtonSymbol="&#xE111;" IsEnabled="{Binding IsSelected}">
@@ -498,10 +497,10 @@
<RowDefinition Height="20" /> <RowDefinition Height="20" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Viewbox MaxHeight="30" Width="50" Grid.Column="0" Grid.Row="0" Visibility="{Binding IsEditMode, Converter={StaticResource BooleanToVisibilityConverter}}"> <Viewbox MaxHeight="30" Width="50" Grid.Column="0" Grid.Row="0" Visibility="{Binding IsEditMode, Converter={StaticResource BooleanToVisibilityConverter}}">
<userControls:SymbolPickerUserControl Width="80" Height="40" SelectedSymbol="{Binding Icon, Converter={StaticResource IntToSymbolConverter}, ConverterParameter=0, Mode=TwoWay}" /> <userControls:SymbolPickerUserControl Width="80" Height="40" SelectedSymbol="{Binding Icon, Mode=TwoWay}" />
</Viewbox> </Viewbox>
<Viewbox MaxHeight="30" Width="50" Grid.Column="0" Grid.Row="0" Visibility="{Binding IsEditMode, Converter={StaticResource InverseBooleanToVisibilityConverter}}"> <Viewbox MaxHeight="30" Width="50" Grid.Column="0" Grid.Row="0" Visibility="{Binding IsEditMode, Converter={StaticResource InverseBooleanToVisibilityConverter}}">
<SymbolIcon Symbol="{Binding Icon, Converter={StaticResource IntToSymbolConverter}}" Width="80" Height="40" /> <SymbolIcon Symbol="{Binding Icon}" Width="80" Height="40" />
</Viewbox> </Viewbox>
<TextBox Grid.Column="1" Grid.Row="0" <TextBox Grid.Column="1" Grid.Row="0"
Text="{Binding Title, Mode=TwoWay}" Text="{Binding Title, Mode=TwoWay}"
@@ -525,7 +524,7 @@
</Grid> </Grid>
<userControls:TopMenuUserControl <userControls:TopMenuUserControl
x:Name="TopMenu" Grid.Column="2" x:Name="TopMenu" Grid.Column="2"
RestoreButtonVisibility="{Binding ParentGroup.IsSelected, Converter={StaticResource BooleanToVisibilityConverter}}" RestoreButtonVisibility="{Binding CanRestore, Converter={StaticResource BooleanToVisibilityConverter}}"
DeleteButtonVisibility="{Binding IsSelected, Converter={StaticResource BooleanToVisibilityConverter}}" DeleteButtonVisibility="{Binding IsSelected, Converter={StaticResource BooleanToVisibilityConverter}}"
IsEditButtonChecked="{Binding IsEditMode, Mode=TwoWay}" IsEditButtonChecked="{Binding IsEditMode, Mode=TwoWay}"
SaveCommand="{Binding SaveCommand}" SaveCommand="{Binding SaveCommand}"

View File

@@ -42,8 +42,10 @@ namespace ModernKeePass.Views
protected override void OnNavigatedTo(NavigationEventArgs e) protected override void OnNavigatedTo(NavigationEventArgs e)
{ {
NavigationHelper.OnNavigatedTo(e); NavigationHelper.OnNavigatedTo(e);
if (!(e.Parameter is EntryVm)) return; /*if (!(e.Parameter is EntryVm)) return;
DataContext = (EntryVm)e.Parameter; DataContext = (EntryVm)e.Parameter;*/
var args = e.Parameter as Application.Entry.Models.EntryVm;
if (args != null) DataContext = new EntryVm(args);
} }
protected override void OnNavigatedFrom(NavigationEventArgs e) protected override void OnNavigatedFrom(NavigationEventArgs e)
@@ -67,7 +69,7 @@ namespace ModernKeePass.Views
case -1: case -1:
return; return;
default: default:
var entry = listView?.SelectedItem as EntryVm; var entry = listView?.SelectedItem as Application.Entry.Models.EntryVm;
StackPanel.DataContext = entry; StackPanel.DataContext = entry;
TopGrid.DataContext = entry; TopGrid.DataContext = entry;
break; break;

View File

@@ -17,8 +17,6 @@
<converters:ColorToBrushConverter x:Key="ColorToBrushConverter"/> <converters:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/> <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<converters:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter"/> <converters:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter"/>
<converters:NullToBooleanConverter x:Key="NullToBooleanConverter"/>
<converters:IntToSymbolConverter x:Key="IntToSymbolConverter"/>
</Page.Resources> </Page.Resources>
<Page.DataContext> <Page.DataContext>
<viewModels:GroupVm /> <viewModels:GroupVm />
@@ -105,13 +103,13 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Border Grid.Column="0" Background="{Binding BackgroundColor, ConverterParameter={StaticResource MainColor}, Converter={StaticResource ColorToBrushConverter}}"> <Border Grid.Column="0" Background="{Binding BackgroundColor, ConverterParameter={StaticResource MainColor}, Converter={StaticResource ColorToBrushConverter}}">
<Viewbox MaxHeight="50" Width="100"> <Viewbox MaxHeight="50" Width="100">
<SymbolIcon Symbol="{Binding Icon, Converter={StaticResource IntToSymbolConverter}, ConverterParameter=0}" Foreground="{StaticResource TextColor}" /> <SymbolIcon Symbol="{Binding Icon}" Foreground="{StaticResource TextColor}" />
</Viewbox> </Viewbox>
</Border> </Border>
<StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="10,10,0,0" > <StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="10,10,0,0" >
<TextBlock x:Name="NameTextBlock" Text="{Binding Title}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap" Foreground="{Binding ForegroundColor, ConverterParameter={StaticResource TextBoxForegroundThemeBrush}, Converter={StaticResource ColorToBrushConverter}}"/> <TextBlock x:Name="NameTextBlock" Text="{Binding Title}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap" Foreground="{Binding ForegroundColor, ConverterParameter={StaticResource TextBoxForegroundThemeBrush}, Converter={StaticResource ColorToBrushConverter}}"/>
<TextBlock Style="{StaticResource CaptionTextBlockStyle}" TextWrapping="NoWrap" /> <TextBlock Style="{StaticResource CaptionTextBlockStyle}" TextWrapping="NoWrap" />
<TextBlock Text="{Binding UserName}" Style="{StaticResource BodyTextBlockStyle}" Foreground="{Binding ForegroundColor, ConverterParameter={StaticResource TextBoxForegroundThemeBrush}, Converter={StaticResource ColorToBrushConverter}}" MaxHeight="60" /> <TextBlock Text="{Binding Username}" Style="{StaticResource BodyTextBlockStyle}" Foreground="{Binding ForegroundColor, ConverterParameter={StaticResource TextBoxForegroundThemeBrush}, Converter={StaticResource ColorToBrushConverter}}" MaxHeight="60" />
<TextBlock Text="{Binding Url}" Style="{StaticResource BodyTextBlockStyle}" Foreground="{Binding ForegroundColor, ConverterParameter={StaticResource TextBoxForegroundThemeBrush}, Converter={StaticResource ColorToBrushConverter}}" MaxHeight="60" /> <TextBlock Text="{Binding Url}" Style="{StaticResource BodyTextBlockStyle}" Foreground="{Binding ForegroundColor, ConverterParameter={StaticResource TextBoxForegroundThemeBrush}, Converter={StaticResource ColorToBrushConverter}}" MaxHeight="60" />
</StackPanel> </StackPanel>
<Button Grid.Column="2" Style="{StaticResource NoBorderButtonStyle}" Background="{StaticResource AppBarBackgroundThemeBrush}" VerticalAlignment="Bottom"> <Button Grid.Column="2" Style="{StaticResource NoBorderButtonStyle}" Background="{StaticResource AppBarBackgroundThemeBrush}" VerticalAlignment="Bottom">
@@ -121,7 +119,7 @@
<MenuFlyoutItem x:Uid="EntryItemCopyLogin"> <MenuFlyoutItem x:Uid="EntryItemCopyLogin">
<interactivity:Interaction.Behaviors> <interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click"> <core:EventTriggerBehavior EventName="Click">
<actions:ClipboardAction Text="{Binding UserName}" /> <actions:ClipboardAction Text="{Binding Username}" />
<actions:ToastAction x:Uid="ToastCopyLogin" Title="{Binding Title}" /> <actions:ToastAction x:Uid="ToastCopyLogin" Title="{Binding Title}" />
</core:EventTriggerBehavior> </core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors> </interactivity:Interaction.Behaviors>
@@ -207,10 +205,10 @@
<RowDefinition Height="20" /> <RowDefinition Height="20" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Viewbox MaxHeight="30" Width="50" Grid.Column="0" Grid.Row="0" Visibility="{Binding IsEditMode, Converter={StaticResource BooleanToVisibilityConverter}}"> <Viewbox MaxHeight="30" Width="50" Grid.Column="0" Grid.Row="0" Visibility="{Binding IsEditMode, Converter={StaticResource BooleanToVisibilityConverter}}">
<userControls:SymbolPickerUserControl Width="80" Height="40" SelectedSymbol="{Binding Icon, Converter={StaticResource IntToSymbolConverter}, ConverterParameter=48, Mode=TwoWay}" /> <userControls:SymbolPickerUserControl Width="80" Height="40" SelectedSymbol="{Binding Icon, Mode=TwoWay}" />
</Viewbox> </Viewbox>
<Viewbox MaxHeight="30" Width="50" Grid.Column="0" Grid.Row="0" Visibility="{Binding IsEditMode, Converter={StaticResource InverseBooleanToVisibilityConverter}}"> <Viewbox MaxHeight="30" Width="50" Grid.Column="0" Grid.Row="0" Visibility="{Binding IsEditMode, Converter={StaticResource InverseBooleanToVisibilityConverter}}">
<SymbolIcon Symbol="{Binding Icon, Converter={StaticResource IntToSymbolConverter}}" Width="80" Height="40" /> <SymbolIcon Symbol="{Binding Icon}" Width="80" Height="40" />
</Viewbox> </Viewbox>
<TextBox Grid.Column="1" Grid.Row="0" <TextBox Grid.Column="1" Grid.Row="0"
x:Name="TitleTextBox" x:Name="TitleTextBox"

View File

@@ -8,6 +8,7 @@ using Windows.UI.Xaml.Navigation;
using ModernKeePass.Common; using ModernKeePass.Common;
using ModernKeePass.Events; using ModernKeePass.Events;
using ModernKeePass.ViewModels; using ModernKeePass.ViewModels;
using EntryVm = ModernKeePass.Application.Entry.Models.EntryVm;
// The Group Detail Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234229 // The Group Detail Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234229
@@ -46,13 +47,13 @@ namespace ModernKeePass.Views
protected override void OnNavigatedTo(NavigationEventArgs e) protected override void OnNavigatedTo(NavigationEventArgs e)
{ {
NavigationHelper.OnNavigatedTo(e); NavigationHelper.OnNavigatedTo(e);
var args = e.Parameter as PasswordEventArgs; var args = e.Parameter as PasswordEventArgs;
if (args != null) if (args != null)
DataContext = args.RootGroup; DataContext = new GroupVm(args.RootGroup);
else else
{ {
var vm = e.Parameter as GroupVm; var vm = e.Parameter as Application.Group.Models.GroupVm;
if (vm != null) if (vm != null)
DataContext = vm; DataContext = vm;
} }
@@ -75,7 +76,7 @@ namespace ModernKeePass.Views
case -1: case -1:
return; return;
default: default:
var group = listView?.SelectedItem as GroupVm; var group = listView?.SelectedItem as Application.Group.Models.GroupVm;
Frame.Navigate(typeof(GroupDetailPage), group); Frame.Navigate(typeof(GroupDetailPage), group);
break; break;
} }

View File

@@ -66,12 +66,11 @@ namespace ModernKeePass.Views
private async void ImportFileButton_OnClick(object sender, RoutedEventArgs e) private async void ImportFileButton_OnClick(object sender, RoutedEventArgs e)
{ {
var picker = var picker = new FileOpenPicker
new FileOpenPicker {
{ ViewMode = PickerViewMode.List,
ViewMode = PickerViewMode.List, SuggestedStartLocation = PickerLocationId.DocumentsLibrary
SuggestedStartLocation = PickerLocationId.DocumentsLibrary };
};
if (!string.IsNullOrEmpty(Model.ImportFileExtensionFilter)) if (!string.IsNullOrEmpty(Model.ImportFileExtensionFilter))
picker.FileTypeFilter.Add(Model.ImportFileExtensionFilter); picker.FileTypeFilter.Add(Model.ImportFileExtensionFilter);
@@ -80,10 +79,10 @@ namespace ModernKeePass.Views
if (Model.ImportFile != null) ImportFileLink.Content = Model.ImportFile.Name; if (Model.ImportFile != null) ImportFileLink.Content = Model.ImportFile.Name;
} }
private void CompositeKeyUserControl_OnValidationChecked(object sender, PasswordEventArgs e) private async void CompositeKeyUserControl_OnValidationChecked(object sender, PasswordEventArgs e)
{ {
Model.PopulateInitialData(DatabaseService.Instance, new SettingsService(), new ImportService()); var rootGroup = await Model.PopulateInitialData();
_mainFrame.Navigate(typeof(GroupDetailPage), DatabaseService.Instance.RootGroup); _mainFrame.Navigate(typeof(GroupDetailPage), rootGroup);
} }
} }
} }

View File

@@ -33,12 +33,11 @@ namespace ModernKeePass.Views
private async void ButtonBase_OnClick(object sender, RoutedEventArgs e) private async void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{ {
var picker = var picker = new FileOpenPicker
new FileOpenPicker {
{ ViewMode = PickerViewMode.List,
ViewMode = PickerViewMode.List, SuggestedStartLocation = PickerLocationId.DocumentsLibrary
SuggestedStartLocation = PickerLocationId.DocumentsLibrary };
};
picker.FileTypeFilter.Add(".kdbx"); picker.FileTypeFilter.Add(".kdbx");
// Application now has read/write access to the picked file // Application now has read/write access to the picked file

View File

@@ -95,7 +95,7 @@ namespace ModernKeePass.Views.UserControls
if (UpdateKey) if (UpdateKey)
{ {
await Model.UpdateKey(); await Model.UpdateKey();
ValidationChecked?.Invoke(this, new PasswordEventArgs(new GroupVm(Model.RootGroup, null))); ValidationChecked?.Invoke(this, new PasswordEventArgs(Model.RootGroup));
} }
else else
{ {
@@ -175,7 +175,7 @@ namespace ModernKeePass.Views.UserControls
ButtonLabel = resource.GetResourceValue("CompositeKeyOpening"); ButtonLabel = resource.GetResourceValue("CompositeKeyOpening");
if (await Dispatcher.RunTaskAsync(async () => await Model.OpenDatabase(DatabaseFile, CreateNew))) if (await Dispatcher.RunTaskAsync(async () => await Model.OpenDatabase(DatabaseFile, CreateNew)))
{ {
ValidationChecked?.Invoke(this, new PasswordEventArgs(new GroupVm(Model.RootGroup, null))); ValidationChecked?.Invoke(this, new PasswordEventArgs(Model.RootGroup));
} }
ButtonLabel = oldLabel; ButtonLabel = oldLabel;

View File

@@ -10,7 +10,7 @@
xmlns:converters="using:ModernKeePass.Converters" xmlns:converters="using:ModernKeePass.Converters"
mc:Ignorable="d"> mc:Ignorable="d">
<UserControl.Resources> <UserControl.Resources>
<converters:IntToSymbolConverter x:Key="IntToSymbolConverter"/> <converters:IconToSymbolConverter x:Key="IconToSymbolConverter"/>
</UserControl.Resources> </UserControl.Resources>
<ListView <ListView
ItemsSource="{Binding ItemsSource, ElementName=UserControl}" ItemsSource="{Binding ItemsSource, ElementName=UserControl}"
@@ -26,7 +26,7 @@
<x:Double x:Key="HamburgerMenuSize">300</x:Double> <x:Double x:Key="HamburgerMenuSize">300</x:Double>
<DataTemplate x:Name="IsSpecial"> <DataTemplate x:Name="IsSpecial">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<SymbolIcon Symbol="{Binding IconId, Converter={StaticResource IntToSymbolConverter}, ConverterParameter=48}" Margin="7,15,0,15"> <SymbolIcon Symbol="{Binding Icon, Converter={StaticResource IconToSymbolConverter}, ConverterParameter=48}" Margin="7,15,0,15">
<ToolTipService.ToolTip> <ToolTipService.ToolTip>
<ToolTip Content="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" /> <ToolTip Content="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" />
</ToolTipService.ToolTip> </ToolTipService.ToolTip>
@@ -36,7 +36,7 @@
</DataTemplate> </DataTemplate>
<DataTemplate x:Name="IsNormal"> <DataTemplate x:Name="IsNormal">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<SymbolIcon Symbol="{Binding IconId, Converter={StaticResource IntToSymbolConverter}, ConverterParameter=48}" Margin="7,15,0,15"> <SymbolIcon Symbol="{Binding Icon, Converter={StaticResource IconToSymbolConverter}, ConverterParameter=48}" Margin="7,15,0,15">
<ToolTipService.ToolTip> <ToolTipService.ToolTip>
<ToolTip Content="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" /> <ToolTip Content="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" />
</ToolTipService.ToolTip> </ToolTipService.ToolTip>

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using Windows.UI.Xaml; using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls;
using ModernKeePass.Interfaces; using ModernKeePass.Application.Common.Interfaces;
// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 // The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
@@ -75,18 +75,18 @@ namespace ModernKeePass.Views.UserControls
typeof(HamburgerMenuUserControl), typeof(HamburgerMenuUserControl),
new PropertyMetadata(Visibility.Collapsed, (o, args) => { })); new PropertyMetadata(Visibility.Collapsed, (o, args) => { }));
public IEnumerable<IVmEntity> ItemsSource public IEnumerable<IEntityVm> ItemsSource
{ {
get { return (IEnumerable<IVmEntity>)GetValue(ItemsSourceProperty); } get { return (IEnumerable<IEntityVm>)GetValue(ItemsSourceProperty); }
set { SetValue(ItemsSourceProperty, value); } set { SetValue(ItemsSourceProperty, value); }
} }
public static readonly DependencyProperty ItemsSourceProperty = public static readonly DependencyProperty ItemsSourceProperty =
DependencyProperty.Register( DependencyProperty.Register(
"ItemsSource", "ItemsSource",
typeof(IEnumerable<IVmEntity>), typeof(IEnumerable<IEntityVm>),
typeof(HamburgerMenuUserControl), typeof(HamburgerMenuUserControl),
new PropertyMetadata(new List<IVmEntity>(), (o, args) => { })); new PropertyMetadata(new List<IEntityVm>(), (o, args) => { }));
public object SelectedItem public object SelectedItem
{ {

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using Windows.UI.Xaml; using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls;
using ModernKeePass.Converters;
// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 // The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
@@ -28,8 +27,7 @@ namespace ModernKeePass.Views.UserControls
public SymbolPickerUserControl() public SymbolPickerUserControl()
{ {
InitializeComponent(); InitializeComponent();
var converter = new IntToSymbolConverter(); Symbols = Enum.GetValues(typeof(Symbol)).Cast<Symbol>();
Symbols = Enum.GetValues(typeof(Symbol)).Cast<Symbol>().Where(s => (int)converter.ConvertBack(s, null, null, string.Empty) != -1);
} }
private void ComboBox_OnLoaded(object sender, RoutedEventArgs e) private void ComboBox_OnLoaded(object sender, RoutedEventArgs e)

View File

@@ -17,7 +17,7 @@
<PackageCertificateKeyFile>ModernKeePass_StoreKey.pfx</PackageCertificateKeyFile> <PackageCertificateKeyFile>ModernKeePass_StoreKey.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>ED3AA34F46D03498F989901C5DB2742B65D72F60</PackageCertificateThumbprint> <PackageCertificateThumbprint>ED3AA34F46D03498F989901C5DB2742B65D72F60</PackageCertificateThumbprint>
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision> <AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<AppxBundlePlatforms>neutral</AppxBundlePlatforms> <AppxBundlePlatforms>x64</AppxBundlePlatforms>
<AppxBundle>Always</AppxBundle> <AppxBundle>Always</AppxBundle>
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp> </NuGetPackageImportStamp>
@@ -117,16 +117,15 @@
<Compile Include="App.xaml.cs"> <Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon> <DependentUpon>App.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Converters\IntToSymbolConverter.cs" /> <Compile Include="Converters\IconToSymbolConverter.cs" />
<Compile Include="DependencyInjection.cs" />
<Compile Include="ImportFormats\CsvImportFormat.cs" /> <Compile Include="ImportFormats\CsvImportFormat.cs" />
<Compile Include="ImportFormats\NullImportFormat.cs" /> <Compile Include="ImportFormats\NullImportFormat.cs" />
<Compile Include="Interfaces\IFormat.cs" /> <Compile Include="Interfaces\IFormat.cs" />
<Compile Include="Interfaces\IImportService.cs" />
<Compile Include="Interfaces\IProxyInvocationHandler.cs" /> <Compile Include="Interfaces\IProxyInvocationHandler.cs" />
<Compile Include="Interfaces\IRecentService.cs" /> <Compile Include="Interfaces\IRecentService.cs" />
<Compile Include="Interfaces\IRecentItem.cs" /> <Compile Include="Interfaces\IRecentItem.cs" />
<Compile Include="Interfaces\IResourceService.cs" /> <Compile Include="Interfaces\IResourceService.cs" />
<Compile Include="Services\ImportService.cs" />
<Compile Include="Services\SingletonServiceBase.cs" /> <Compile Include="Services\SingletonServiceBase.cs" />
<Compile Include="TemplateSelectors\SelectableDataTemplateSelector.cs" /> <Compile Include="TemplateSelectors\SelectableDataTemplateSelector.cs" />
<Compile Include="ViewModels\Items\SettingsSaveVm.cs" /> <Compile Include="ViewModels\Items\SettingsSaveVm.cs" />
@@ -392,14 +391,18 @@
<Reference Include="Autofac"> <Reference Include="Autofac">
<HintPath>..\..\..\..\..\.nuget\packages\Autofac\4.9.4\lib\netstandard1.1\Autofac.dll</HintPath> <HintPath>..\..\..\..\..\.nuget\packages\Autofac\4.9.4\lib\netstandard1.1\Autofac.dll</HintPath>
</Reference> </Reference>
<Reference Include="AutoMapper, Version=6.1.1.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL"> <Reference Include="AutoMapper, Version=6.0.2.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
<HintPath>..\packages\AutoMapper.6.1.1\lib\netstandard1.1\AutoMapper.dll</HintPath> <HintPath>..\packages\AutoMapper.6.0.2\lib\netstandard1.1\AutoMapper.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="AutoMapper.Extensions.Microsoft.DependencyInjection, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="AutoMapper.Extensions.Microsoft.DependencyInjection, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\AutoMapper.Extensions.Microsoft.DependencyInjection.2.0.1\lib\netstandard1.1\AutoMapper.Extensions.Microsoft.DependencyInjection.dll</HintPath> <HintPath>..\packages\AutoMapper.Extensions.Microsoft.DependencyInjection.2.0.1\lib\netstandard1.1\AutoMapper.Extensions.Microsoft.DependencyInjection.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.8.5\lib\netstandard1.0\BouncyCastle.Crypto.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentValidation, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7de548da2fbae0f0, processorArchitecture=MSIL"> <Reference Include="FluentValidation, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7de548da2fbae0f0, processorArchitecture=MSIL">
<HintPath>..\packages\FluentValidation.8.6.2\lib\netstandard1.1\FluentValidation.dll</HintPath> <HintPath>..\packages\FluentValidation.8.6.2\lib\netstandard1.1\FluentValidation.dll</HintPath>
<Private>True</Private> <Private>True</Private>
@@ -436,6 +439,22 @@
<HintPath>..\packages\Microsoft.Toolkit.Uwp.Notifications.2.0.0\lib\dotnet\Microsoft.Toolkit.Uwp.Notifications.dll</HintPath> <HintPath>..\packages\Microsoft.Toolkit.Uwp.Notifications.2.0.0\lib\dotnet\Microsoft.Toolkit.Uwp.Notifications.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="ModernKeePassLib, Version=2.44.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ModernKeePassLib.2.44.2\lib\netstandard1.2\ModernKeePassLib.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SixLabors.Core, Version=0.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SixLabors.Core.1.0.0-beta0006\lib\netstandard1.1\SixLabors.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SixLabors.ImageSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SixLabors.ImageSharp.1.0.0-beta0005\lib\netstandard1.1\SixLabors.ImageSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Splat, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Splat.3.0.0\lib\netstandard1.1\Splat.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.0\lib\netstandard1.1\System.Buffers.dll</HintPath> <HintPath>..\packages\System.Buffers.4.5.0\lib\netstandard1.1\System.Buffers.dll</HintPath>
<Private>True</Private> <Private>True</Private>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="AutoMapper" version="6.1.1" targetFramework="win81" /> <package id="AutoMapper" version="6.0.2" targetFramework="win81" />
<package id="AutoMapper.Extensions.Microsoft.DependencyInjection" version="2.0.1" targetFramework="win81" /> <package id="AutoMapper.Extensions.Microsoft.DependencyInjection" version="2.0.1" targetFramework="win81" />
<package id="FluentValidation" version="8.6.2" targetFramework="win81" /> <package id="FluentValidation" version="8.6.2" targetFramework="win81" />
<package id="HockeySDK.Core" version="4.1.6" targetFramework="win81" /> <package id="HockeySDK.Core" version="4.1.6" targetFramework="win81" />
@@ -14,7 +14,12 @@
<package id="Microsoft.NETCore.Portable.Compatibility" version="1.0.1" targetFramework="win81" /> <package id="Microsoft.NETCore.Portable.Compatibility" version="1.0.1" targetFramework="win81" />
<package id="Microsoft.NETCore.UniversalWindowsPlatform" version="6.1.7" targetFramework="win81" /> <package id="Microsoft.NETCore.UniversalWindowsPlatform" version="6.1.7" targetFramework="win81" />
<package id="Microsoft.Toolkit.Uwp.Notifications" version="2.0.0" targetFramework="win81" /> <package id="Microsoft.Toolkit.Uwp.Notifications" version="2.0.0" targetFramework="win81" />
<package id="ModernKeePassLib" version="2.44.2" targetFramework="win81" />
<package id="NETStandard.Library" version="2.0.3" targetFramework="win81" /> <package id="NETStandard.Library" version="2.0.3" targetFramework="win81" />
<package id="Portable.BouncyCastle" version="1.8.5" targetFramework="win81" />
<package id="SixLabors.Core" version="1.0.0-beta0006" targetFramework="win81" />
<package id="SixLabors.ImageSharp" version="1.0.0-beta0005" targetFramework="win81" />
<package id="Splat" version="3.0.0" targetFramework="win81" />
<package id="System.Buffers" version="4.5.0" targetFramework="win81" /> <package id="System.Buffers" version="4.5.0" targetFramework="win81" />
<package id="System.Collections" version="4.3.0" targetFramework="win81" /> <package id="System.Collections" version="4.3.0" targetFramework="win81" />
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="win81" /> <package id="System.Collections.Concurrent" version="4.3.0" targetFramework="win81" />