/// <summary> /// Implements the logic to terminate the desktop, including closing all windows and terminating the session. /// </summary> /// <returns>True if the application is really going to terminate, false otherwise.</returns> private void DoQuit(bool force) { if (IsQuitting) { return; } PhoneHome.ShutDown(); if (!force) { _quitState = QuitState.QuittingNormally; if (!CloseAllWindows()) { _quitState = QuitState.NotQuitting; return; } // send quitting event QuittingEventArgs args = new QuittingEventArgs(); OnQuitting(args); // ensure the action model is disposed - this will cause it to be written out to the store ActionModelSettings.Default.Dispose(); } else { _quitState = QuitState.QuittingForcefully; } try { SessionManager.Current.TerminateSession(); } catch (Exception e) { Platform.Log(LogLevel.Error, e); } // shut down the GUI message loop TerminateGuiToolkit(); }
/// <summary> /// Implements the logic to terminate the desktop, including closing all windows and terminating the session. /// </summary> /// <returns>True if the application is really going to terminate, false otherwise.</returns> private void DoQuit(bool force) { if (IsQuitting) { return; } PhoneHome.ShutDown(); if (!force) { _quitState = QuitState.QuittingNormally; if (!CloseAllWindows()) { _quitState = QuitState.NotQuitting; return; } // send quitting event QuittingEventArgs args = new QuittingEventArgs(); OnQuitting(args); } else { _quitState = QuitState.QuittingForcefully; } try { SessionManager.Current.TerminateSession(); } catch (Exception e) { Platform.Log(LogLevel.Error, e); } // shut down the GUI message loop TerminateGuiToolkit(); }
/// <summary> /// Raises the <see cref="Quitting"/> event. /// </summary> protected virtual void OnQuitting(QuittingEventArgs args) { EventsHelper.Fire(_quitting, this, args); }