mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
Don't use mediator for App services (recent, resource, settings)
WIP in View models
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
using MediatR;
|
||||
using ModernKeePass.Application.Common.Interfaces;
|
||||
using ModernKeePass.Application.Group.Models;
|
||||
using ModernKeePass.Domain.Exceptions;
|
||||
|
||||
namespace ModernKeePass.Application.Parameters.Commands.SetRecycleBin
|
||||
{
|
||||
public class SetRecycleBinCommand : IRequest
|
||||
{
|
||||
public string RecycleBinId { get; set; }
|
||||
public GroupVm RecycleBin { get; set; }
|
||||
|
||||
public class SetRecycleBinCommandHandler : IRequestHandler<SetRecycleBinCommand>
|
||||
{
|
||||
@@ -19,7 +20,7 @@ namespace ModernKeePass.Application.Parameters.Commands.SetRecycleBin
|
||||
|
||||
public void Handle(SetRecycleBinCommand message)
|
||||
{
|
||||
if (_database.IsOpen) _database.RecycleBinId = message.RecycleBinId;
|
||||
if (_database.IsOpen) _database.SetRecycleBin(message.RecycleBin.Id);
|
||||
else throw new DatabaseClosedException();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user