Groups can now also be manually reordered

Design improvements
This commit is contained in:
Geoffroy BONNEVILLE
2020-05-11 19:22:41 +02:00
parent bb2b99ed66
commit d6dc6a74a3
20 changed files with 196 additions and 122 deletions

View File

@@ -189,6 +189,20 @@ namespace ModernKeePass.Infrastructure.KeePass
parentPwGroup.AddGroup(pwGroup, true);
});
}
public async Task MoveGroup(string parentGroupId, string groupId, int index)
{
await Task.Run(() =>
{
var parentPwGroup = _pwDatabase.RootGroup.FindGroup(BuildIdFromString(parentGroupId), true);
var pwGroup = _pwDatabase.RootGroup.FindGroup(BuildIdFromString(groupId), true);
var currentIndex = (uint)parentPwGroup.Groups.IndexOf(pwGroup);
parentPwGroup.Groups.RemoveAt(currentIndex);
parentPwGroup.Groups.Insert((uint)index, pwGroup);
});
}
public async Task RemoveEntry(string parentGroupId, string entryId)
{
await Task.Run(() =>