diff --git a/ModernKeePass/App.xaml.cs b/ModernKeePass/App.xaml.cs
index 7485dc3..ec0e157 100644
--- a/ModernKeePass/App.xaml.cs
+++ b/ModernKeePass/App.xaml.cs
@@ -63,10 +63,10 @@ namespace ModernKeePass
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
///
- /// Details about the launch request and process.
- protected override async void OnLaunched(LaunchActivatedEventArgs e)
+ /// Details about the launch request and process.
+ protected override async void OnLaunched(LaunchActivatedEventArgs args)
{
- OnLaunchOrActivated(e);
+ OnLaunchOrActivated(args);
await HockeyClient.Current.SendCrashesAsync(/* sendWithoutAsking: true */);
}
@@ -81,7 +81,7 @@ namespace ModernKeePass
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
- //DebugSettings.EnableFrameRateCounter = true;
+ DebugSettings.EnableFrameRateCounter = true;
}
#endif
@@ -109,9 +109,9 @@ namespace ModernKeePass
Window.Current.Content = rootFrame;
}
- if (e is LaunchActivatedEventArgs)
+ var lauchActivatedEventArgs = e as LaunchActivatedEventArgs;
+ if (lauchActivatedEventArgs != null)
{
- var lauchActivatedEventArgs = (LaunchActivatedEventArgs) e;
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
@@ -119,20 +119,8 @@ namespace ModernKeePass
// parameter
rootFrame.Navigate(typeof(MainPage), lauchActivatedEventArgs.Arguments);
}
- /*else
- {
- // App is "launched" via the Toast Activation event
- UndoEntityDelete(lauchActivatedEventArgs.Arguments);
- }*/
}
- // This is only available on Windows 10...
- /*else if (e is ToastNotificationActivatedEventArgs)
- {
- var toastActivationArgs = e as ToastNotificationActivatedEventArgs;
-
- // Parse the query string (using QueryString.NET)
- UndoEntityDelete(QueryString.Parse(toastActivationArgs.Argument));
- }*/
+
// Ensure the current window is active
Window.Current.Activate();
}
diff --git a/ModernKeePass/Common/MessageDialogHelper.cs b/ModernKeePass/Common/MessageDialogHelper.cs
index 3bf8d03..72772d0 100644
--- a/ModernKeePass/Common/MessageDialogHelper.cs
+++ b/ModernKeePass/Common/MessageDialogHelper.cs
@@ -74,7 +74,7 @@ namespace ModernKeePass.Common
// Create the message dialog and set its content
var messageDialog = new MessageDialog(message, title);
- // Add commands and set their callbacks;
+ // Add commands and set their callbacks
messageDialog.Commands.Add(new UICommand(dismissActionText, cancelCommand));
// Set the command that will be invoked by default
diff --git a/ModernKeePass/Common/ObservableDictionary.cs b/ModernKeePass/Common/ObservableDictionary.cs
index 48dab88..f5845eb 100644
--- a/ModernKeePass/Common/ObservableDictionary.cs
+++ b/ModernKeePass/Common/ObservableDictionary.cs
@@ -1,5 +1,4 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Linq;
using Windows.Foundation.Collections;
@@ -15,15 +14,15 @@ namespace ModernKeePass.Common
{
public ObservableDictionaryChangedEventArgs(CollectionChange change, string key)
{
- this.CollectionChange = change;
- this.Key = key;
+ CollectionChange = change;
+ Key = key;
}
public CollectionChange CollectionChange { get; private set; }
public string Key { get; private set; }
}
- private Dictionary _dictionary = new Dictionary();
+ private readonly Dictionary _dictionary = new Dictionary();
public event MapChangedEventHandler MapChanged;
private void InvokeMapChanged(CollectionChange change, string key)
@@ -37,13 +36,13 @@ namespace ModernKeePass.Common
public void Add(string key, object value)
{
- this._dictionary.Add(key, value);
- this.InvokeMapChanged(CollectionChange.ItemInserted, key);
+ _dictionary.Add(key, value);
+ InvokeMapChanged(CollectionChange.ItemInserted, key);
}
public void Add(KeyValuePair item)
{
- this.Add(item.Key, item.Value);
+ Add(item.Key, item.Value);
}
public void AddRange(IEnumerable> values)
@@ -56,9 +55,9 @@ namespace ModernKeePass.Common
public bool Remove(string key)
{
- if (this._dictionary.Remove(key))
+ if (_dictionary.Remove(key))
{
- this.InvokeMapChanged(CollectionChange.ItemRemoved, key);
+ InvokeMapChanged(CollectionChange.ItemRemoved, key);
return true;
}
return false;
@@ -67,10 +66,10 @@ namespace ModernKeePass.Common
public bool Remove(KeyValuePair item)
{
object currentValue;
- if (this._dictionary.TryGetValue(item.Key, out currentValue) &&
- Object.Equals(item.Value, currentValue) && this._dictionary.Remove(item.Key))
+ if (_dictionary.TryGetValue(item.Key, out currentValue) &&
+ Equals(item.Value, currentValue) && _dictionary.Remove(item.Key))
{
- this.InvokeMapChanged(CollectionChange.ItemRemoved, item.Key);
+ InvokeMapChanged(CollectionChange.ItemRemoved, item.Key);
return true;
}
return false;
@@ -80,53 +79,53 @@ namespace ModernKeePass.Common
{
get
{
- return this._dictionary[key];
+ return _dictionary[key];
}
set
{
- this._dictionary[key] = value;
- this.InvokeMapChanged(CollectionChange.ItemChanged, key);
+ _dictionary[key] = value;
+ InvokeMapChanged(CollectionChange.ItemChanged, key);
}
}
public void Clear()
{
- var priorKeys = this._dictionary.Keys.ToArray();
- this._dictionary.Clear();
+ var priorKeys = _dictionary.Keys.ToArray();
+ _dictionary.Clear();
foreach (var key in priorKeys)
{
- this.InvokeMapChanged(CollectionChange.ItemRemoved, key);
+ InvokeMapChanged(CollectionChange.ItemRemoved, key);
}
}
public ICollection Keys
{
- get { return this._dictionary.Keys; }
+ get { return _dictionary.Keys; }
}
public bool ContainsKey(string key)
{
- return this._dictionary.ContainsKey(key);
+ return _dictionary.ContainsKey(key);
}
public bool TryGetValue(string key, out object value)
{
- return this._dictionary.TryGetValue(key, out value);
+ return _dictionary.TryGetValue(key, out value);
}
public ICollection