mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Clipboard action now sets an expiration timer
WIP Max History count (back-end done, front-end todo)
This commit is contained in:
@@ -106,6 +106,7 @@
|
||||
<Compile Include="Parameters\Commands\SetCipher\SetCipherCommand.cs" />
|
||||
<Compile Include="Parameters\Commands\SetCompression\SetCompressionCommand.cs" />
|
||||
<Compile Include="Parameters\Commands\SetHasRecycleBin\SetHasRecycleBinCommand.cs" />
|
||||
<Compile Include="Parameters\Commands\SetMaxHistoryCount\SetHistoryCountCommand.cs" />
|
||||
<Compile Include="Parameters\Commands\SetKeyDerivation\SetKeyDerivationCommand.cs" />
|
||||
<Compile Include="Parameters\Commands\SetRecycleBin\SetRecycleBinCommand.cs" />
|
||||
<Compile Include="Parameters\Models\CipherVm.cs" />
|
||||
|
@@ -22,6 +22,7 @@ namespace ModernKeePass.Application.Common.Interfaces
|
||||
string FileAccessToken { get; set; }
|
||||
int Size { get; set; }
|
||||
bool IsDirty { get; set; }
|
||||
int MaxHistoryCount { get; set; }
|
||||
|
||||
Task Open(byte[] file, Credentials credentials);
|
||||
Task ReOpen(byte[] file);
|
||||
|
@@ -12,5 +12,6 @@
|
||||
public string KeyDerivationId { get; set; }
|
||||
public int Size { get; internal set; }
|
||||
public bool IsDirty { get; internal set; }
|
||||
public int MaxHistoryCount { get; set; }
|
||||
}
|
||||
}
|
@@ -33,6 +33,7 @@ namespace ModernKeePass.Application.Database.Queries.GetDatabase
|
||||
database.KeyDerivationId = _databaseProxy.KeyDerivationId;
|
||||
database.Size = _databaseProxy.Size;
|
||||
database.IsDirty = _databaseProxy.IsDirty;
|
||||
database.MaxHistoryCount = _databaseProxy.MaxHistoryCount;
|
||||
}
|
||||
return database;
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
using MediatR;
|
||||
using ModernKeePass.Application.Common.Interfaces;
|
||||
using ModernKeePass.Domain.Exceptions;
|
||||
|
||||
namespace ModernKeePass.Application.Parameters.Commands.SetMaxHistoryCount
|
||||
{
|
||||
public class SetMaxHistoryCountCommand : IRequest
|
||||
{
|
||||
public int MaxHistoryCount { get; set; }
|
||||
|
||||
public class SetMaxHistoryCountCommandHandler : IRequestHandler<SetMaxHistoryCountCommand>
|
||||
{
|
||||
private readonly IDatabaseProxy _database;
|
||||
|
||||
public SetMaxHistoryCountCommandHandler(IDatabaseProxy database)
|
||||
{
|
||||
_database = database;
|
||||
}
|
||||
|
||||
public void Handle(SetMaxHistoryCountCommand message)
|
||||
{
|
||||
if (_database.IsOpen) _database.MaxHistoryCount = message.MaxHistoryCount;
|
||||
else throw new DatabaseClosedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user