Recycle bin restore function (actually implemented a move functionality, for later)

This commit is contained in:
2017-10-31 18:49:18 +01:00
committed by BONNEVILLE Geoffroy
parent d32f312d60
commit 7e642e3b73
16 changed files with 163 additions and 141 deletions

View File

@@ -20,7 +20,6 @@ namespace ModernKeePass
sealed partial class App
{
public DatabaseHelper Database { get; set; } = new DatabaseHelper();
public Dictionary<string, IPwEntity> PendingDeleteEntities = new Dictionary<string, IPwEntity>();
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
@@ -89,11 +88,11 @@ namespace ModernKeePass
// parameter
rootFrame.Navigate(typeof(Pages.MainPage), lauchActivatedEventArgs.Arguments);
}
else
/*else
{
// App is "launched" via the Toast Activation event
UndoEntityDelete(lauchActivatedEventArgs.Arguments);
}
}*/
}
// This is only available on Windows 10...
/*else if (e is ToastNotificationActivatedEventArgs)
@@ -145,14 +144,5 @@ namespace ModernKeePass
Window.Current.Activate();
}
#endregion
private void UndoEntityDelete(string arguments)
{
if (arguments == null) return;
var args = JsonObject.Parse(arguments);
var entity = PendingDeleteEntities[args["entityId"].GetString()];
PendingDeleteEntities.Remove(args["entityId"].GetString());
entity.UndoDelete();
}
}
}