Esempio n. 1
0
        /// <summary>
        /// Perform logout
        /// </summary>
        /// <returns>TRUE if Logout successful</returns>
        public bool Logout()
        {
            MainWindow mainWindow = MainWindow as MainWindow;
            var        navService = mainWindow?.NavigationService;

            if (navService == null)
            {
                return(false);
            }

            Service service = mainWindow.Service;

            string message = mainWindow.AppServices.LocalizedString("Message_LogOut_question") + Environment.NewLine;

            if (service.KillSwitchIsEnabled &&
                (service.State != ServiceState.Disconnected && service.State != ServiceState.Uninitialized))
            {
                message += mainWindow.AppServices.LocalizedString("Message_LogOut_actioninfo_firewall_and_connection");
            }
            else if (service.State != ServiceState.Disconnected && service.State != ServiceState.Uninitialized)
            {
                message += mainWindow.AppServices.LocalizedString("Message_LogOut_actioninfo_connection");
            }
            else if (service.KillSwitchIsEnabled)
            {
                message += mainWindow.AppServices.LocalizedString("Message_LogOut_actioninfo_firewall");
            }

            if (MessageBox.Show(mainWindow, message, "Log out...", MessageBoxButton.OKCancel, MessageBoxImage.Question) !=
                MessageBoxResult.OK)
            {
                return(false);
            }

            SettingsWindow.CloseSettingsWindow();
            SubscriptionExpireWindow.Close();
            PrivateEmailManager.CloseAllWindows();
            PrivateEmailGenerateWindow.CloseAllWindows();

            navService.NavigateToLogOutPage(NavigationAnimation.FadeToRight);
            return(true);
        }
Esempio n. 2
0
 private void GuiMenuItemGeneratePrivateEmail_OnClick(object sender, RoutedEventArgs e)
 {
     GuiPrivateEmailsManuPopup.IsOpen = false;
     PrivateEmailGenerateWindow.GenerateEmail(__ViewModelPrivateEmails);
 }
Esempio n. 3
0
 public void PrivateEmailGenerateNew()
 {
     PrivateEmailGenerateWindow.GenerateEmail(PrivateEmailsViewModel);
 }