mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-04 16:10:16 -04:00

Changed the way recent files are retrieved Stopped showing the DB Closed exception on suspend Reordering entries works Moved code from infra to application Cleanup
28 lines
881 B
C#
28 lines
881 B
C#
using MediatR;
|
|
using ModernKeePass.Application.Common.Interfaces;
|
|
using ModernKeePass.Domain.Common;
|
|
using ModernKeePass.Domain.Exceptions;
|
|
|
|
namespace ModernKeePass.Application.Parameters.Commands.SetRecycleBin
|
|
{
|
|
public class SetRecycleBinCommand : IRequest
|
|
{
|
|
public string RecycleBinId { get; set; }
|
|
|
|
public class SetRecycleBinCommandHandler : IRequestHandler<SetRecycleBinCommand>
|
|
{
|
|
private readonly IDatabaseProxy _database;
|
|
|
|
public SetRecycleBinCommandHandler(IDatabaseProxy database)
|
|
{
|
|
_database = database;
|
|
}
|
|
|
|
public void Handle(SetRecycleBinCommand message)
|
|
{
|
|
if (!_database.IsOpen) throw new DatabaseClosedException();
|
|
_database.RecycleBinId = message.RecycleBinId ?? Constants.EmptyId;
|
|
}
|
|
}
|
|
}
|
|
} |