mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-04 08:00:16 -04:00
More commands/queries
WIP on XAML EntryVm and GroupVm
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using MediatR;
|
||||
using ModernKeePass.Application.Common.Interfaces;
|
||||
using ModernKeePass.Domain.Exceptions;
|
||||
|
||||
namespace ModernKeePass.Application.Cryptography.Commands.SetCompression
|
||||
{
|
||||
public class SetCompressionCommand : IRequest
|
||||
{
|
||||
public string Compression { get; set; }
|
||||
|
||||
public class SetCompressionCommandHandler : IRequestHandler<SetCompressionCommand>
|
||||
{
|
||||
private readonly IDatabaseProxy _database;
|
||||
|
||||
public SetCompressionCommandHandler(IDatabaseProxy database)
|
||||
{
|
||||
_database = database;
|
||||
}
|
||||
|
||||
public void Handle(SetCompressionCommand message)
|
||||
{
|
||||
if (_database.IsOpen) _database.Compression = message.Compression;
|
||||
else throw new DatabaseClosedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user