Additional fields Add, Update and Delete work (too well)

SelectableListView works when programmatically setting selection
This commit is contained in:
Geoffroy BONNEVILLE
2020-05-11 10:53:14 +02:00
parent 71b6009a29
commit bb2b99ed66
20 changed files with 274 additions and 101 deletions

View File

@@ -242,9 +242,18 @@ namespace ModernKeePass.Infrastructure.KeePass
case EntryFieldName.ForegroundColor:
pwEntry.ForegroundColor = (Color)fieldValue;
break;
default:
pwEntry.Strings.Set(fieldName, new ProtectedString(true, fieldValue.ToString()));
break;
}
}
public void DeleteField(string entryId, string fieldName)
{
var pwEntry = _pwDatabase.RootGroup.FindEntry(BuildIdFromString(entryId), true);
pwEntry.Strings.Remove(fieldName);
}
public EntryEntity AddHistory(string entryId)
{
var pwEntry = _pwDatabase.RootGroup.FindEntry(BuildIdFromString(entryId), true);
@@ -306,7 +315,7 @@ namespace ModernKeePass.Infrastructure.KeePass
var pwGroup = _pwDatabase.RootGroup.FindGroup(BuildIdFromString(groupId), true);
pwGroup.SortSubGroups(false);
}
public void AddAttachment(string entryId, string attachmentName, byte[] attachmentContent)
{
var pwEntry = _pwDatabase.RootGroup.FindEntry(BuildIdFromString(entryId), true);