Beispiel #1
0
 private void OnLoggingOut(object sender, EventArgs e)
 {
     DisplayStatus = WindowDisplayStatus.OnLoginScreen;
     App.Current.ClearSessionID();
     MainScreenWindow.ForceClose();
     _mainScreenWindow = null;
 }
Beispiel #2
0
        private void ClosePreviousWindow()
        {
            if (_preStatus != DisplayStatus)
            {
                switch (_preStatus)
                {
                case WindowDisplayStatus.OnLoginScreen:
                    if (DisplayStatus == WindowDisplayStatus.OnMainScreen)
                    {
                        LoginScreenWindow?.Hide();
                    }
                    else
                    {
                        ExitApplication();
                    }
                    break;

                case WindowDisplayStatus.OnMainScreen:
                    MainScreenWindow?.Close();
                    break;

                default:
                    break;
                }
            }
        }
Beispiel #3
0
 private void CloseMainScreenWindow(object obj)
 {
     if (_notityIconEnable && DisplayStatus != WindowDisplayStatus.AppExit)
     {
         MainScreenWindow?.Hide();
     }
     else
     {
         ExitApplication();
     }
 }
Beispiel #4
0
        private void ShowCurrentWindow()
        {
            switch (DisplayStatus)
            {
            case WindowDisplayStatus.OnLoginScreen:
                LoginScreenWindow?.Show();
                break;

            case WindowDisplayStatus.OnMainScreen:
                MainScreenWindow?.Show();
                break;

            default:
                break;
            }
        }
Beispiel #5
0
 private void ExitApplication()
 {
     if (!_isLoginWindowExited)
     {
         _isLoginWindowExited = true;
         LoginScreenWindow?.ForceClose();
     }
     if (!_isMainWindowExited)
     {
         _isMainWindowExited = true;
         MainScreenWindow?.ForceClose();
     }
     if (_notityIconEnable)
     {
         _notifyIcon?.Dispose();
         _notifyIcon = null;
     }
     DbManager.Instance.Dispose();
 }