Beispiel #1
0
        public void LeaveSharingSession()
        {
            string           messageBoxText = MessageIds.SHARING_SESSION_SAVE_CONFIRMATION;
            MessageBoxResult result         = MessageBox.Show(messageBoxText, "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (result == MessageBoxResult.Yes)
            {
                DatabaseContextUtility.SaveMessengers(PageManager.Instance.MessengerCache);
            }
            IsSharingSession = false;
            SetRootObjects();
            PageManager.Instance.NewDataScope(DatabaseContextUtility.LoadAllGeneralMessenger());
            SharingStateMessage = MessageIds.SHARING_SESSION_LEAVE;
        }
 protected override void OnClosing(CancelEventArgs e)
 {
     if (ManageViewModel.M2qttManager != null)
     {
         ManageViewModel.M2qttManager.Disconnect();
     }
     if (ManageViewModel.IsSharingSession == true)
     {
         string           messageBoxText = "If you close the application while in sharing mode, all shared messengers will be discarded, do you want to save them?";
         MessageBoxResult result         = MessageBox.Show(messageBoxText, "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question);
         if (result == MessageBoxResult.Yes)
         {
             DatabaseContextUtility.SaveMessengers(PageManager.Instance.MessengerCache);
         }
     }
     ActivityLogManager.SendActivityLog();
     ActivityLogManager.SaveActivityLog();
     Application.Current.Shutdown();
     System.Diagnostics.Process.GetCurrentProcess().Kill();
 }