Updated Settings page

Added new settings (history and clipboard)
Renamed and moved Settings Vms
This commit is contained in:
Geoffroy BONNEVILLE
2020-05-13 13:50:33 +02:00
parent 7ac1595aaa
commit d38d6461bd
42 changed files with 777 additions and 164 deletions

View File

@@ -0,0 +1,32 @@
using MediatR;
using ModernKeePass.Application.Database.Models;
using ModernKeePass.Application.Database.Queries.GetDatabase;
using ModernKeePass.Application.Parameters.Commands.SetMaxHistoryCount;
using ModernKeePass.Application.Parameters.Commands.SetMaxHistorySize;
namespace ModernKeePass.ViewModels.Settings
{
public class HistoryVm
{
private readonly IMediator _mediator;
private readonly DatabaseVm _database;
public int MaxCount
{
get { return _database.MaxHistoryCount; }
set { _mediator.Send(new SetMaxHistoryCountCommand { MaxHistoryCount = value }).Wait(); }
}
public long MaxSize
{
get { return _database.MaxHistorySize / 1024 / 1024; }
set { _mediator.Send(new SetMaxHistorySizeCommand { MaxHistorySize = value * 1024 * 1024 }).Wait(); }
}
public HistoryVm(IMediator mediator)
{
_mediator = mediator;
_database = _mediator.Send(new GetDatabaseQuery()).GetAwaiter().GetResult();
}
}
}