mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Additional fields Add, Update and Delete work (too well)
SelectableListView works when programmatically setting selection
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using MediatR;
|
||||
using ModernKeePass.Application.Common.Interfaces;
|
||||
using ModernKeePass.Domain.Exceptions;
|
||||
|
||||
namespace ModernKeePass.Application.Entry.Commands.DeleteField
|
||||
{
|
||||
public class DeleteFieldCommand: IRequest
|
||||
{
|
||||
public string EntryId { get; set; }
|
||||
public string FieldName { get; set; }
|
||||
|
||||
public class DeleteFieldCommandHandler : IRequestHandler<DeleteFieldCommand>
|
||||
{
|
||||
private readonly IDatabaseProxy _database;
|
||||
|
||||
public DeleteFieldCommandHandler(IDatabaseProxy database)
|
||||
{
|
||||
_database = database;
|
||||
}
|
||||
|
||||
public void Handle(DeleteFieldCommand message)
|
||||
{
|
||||
if (!_database.IsOpen) throw new DatabaseClosedException();
|
||||
|
||||
_database.DeleteField(message.EntryId, message.FieldName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user