/// <summary>
 ///     Returns to login window
 /// </summary>
 private void OpenOnClick(object sender, RoutedEventArgs e)
 {
     LoginWindow loginWindow = new LoginWindow();
     loginWindow.Show();
     Close();
 }
        /// <summary>
        ///     Checks for global key press events
        /// </summary>
        private void GlobalHotkeys(object sender, KeyEventArgs e)
        {
            if (!_safeLocked)
            {
                if (Keyboard.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift))
                    switch (e.Key)
                    {
                        case Key.S:
                            SaveAs();
                            break;
                    }

                else if (Keyboard.Modifiers == ModifierKeys.Control)
                    switch (e.Key)
                    {
                        case Key.N:
                            NewSafe();
                            break;
                        case Key.O:
                            LoginWindow loginWindow = new LoginWindow();
                            loginWindow.Show();
                            Close();
                            break;
                        case Key.S:
                            if (_needsSaving)
                                StartSaveThread();
                            break;
                        case Key.L:
                            LockSafe();
                            _idleDetectionThread.Abort();
                            break;
                        case Key.X:
                            Close();
                            break;
                        case Key.F:
                            CreateNewFolder();
                            break;
                        case Key.Y:
                            CreateNewAccount();
                            break;
                        case Key.E:
                            EditAccount();
                            break;
                        case Key.D:
                            DeleteAccount();
                            break;
                    }
            }
            else if ((Keyboard.Modifiers == ModifierKeys.Control) && (e.Key == Key.L))
            {
                UnlockSafe();
                _idleDetectionThread.Abort();
            }
        }