mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Attachment Add and Delete commands implemented
This commit is contained in:
@@ -244,7 +244,7 @@ namespace ModernKeePass.Infrastructure.KeePass
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public EntryEntity AddHistory(string entryId)
|
||||
{
|
||||
var pwEntry = _pwDatabase.RootGroup.FindEntry(BuildIdFromString(entryId), true);
|
||||
@@ -307,6 +307,18 @@ namespace ModernKeePass.Infrastructure.KeePass
|
||||
pwGroup.SortSubGroups(false);
|
||||
}
|
||||
|
||||
public void AddAttachment(string entryId, string attachmentName, byte[] attachmentContent)
|
||||
{
|
||||
var pwEntry = _pwDatabase.RootGroup.FindEntry(BuildIdFromString(entryId), true);
|
||||
pwEntry.Binaries.Set(attachmentName, new ProtectedBinary(true, attachmentContent));
|
||||
}
|
||||
|
||||
public void DeleteAttachment(string entryId, string attachmentName)
|
||||
{
|
||||
var pwEntry = _pwDatabase.RootGroup.FindEntry(BuildIdFromString(entryId), true);
|
||||
pwEntry.Binaries.Remove(attachmentName);
|
||||
}
|
||||
|
||||
public EntryEntity GetEntry(string id)
|
||||
{
|
||||
var pwEntry = _pwDatabase.RootGroup.FindEntry(BuildIdFromString(id), true);
|
||||
|
Reference in New Issue
Block a user