private void OnLoggingOut(object sender, EventArgs e) { DisplayStatus = WindowDisplayStatus.OnLoginScreen; App.Current.ClearSessionID(); MainScreenWindow.ForceClose(); _mainScreenWindow = null; }
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; } } }
private void CloseMainScreenWindow(object obj) { if (_notityIconEnable && DisplayStatus != WindowDisplayStatus.AppExit) { MainScreenWindow?.Hide(); } else { ExitApplication(); } }
private void ShowCurrentWindow() { switch (DisplayStatus) { case WindowDisplayStatus.OnLoginScreen: LoginScreenWindow?.Show(); break; case WindowDisplayStatus.OnMainScreen: MainScreenWindow?.Show(); break; default: break; } }
private void ExitApplication() { if (!_isLoginWindowExited) { _isLoginWindowExited = true; LoginScreenWindow?.ForceClose(); } if (!_isMainWindowExited) { _isMainWindowExited = true; MainScreenWindow?.ForceClose(); } if (_notityIconEnable) { _notifyIcon?.Dispose(); _notifyIcon = null; } DbManager.Instance.Dispose(); }