Here are the examples of the csharp api class System.Windows.Forms.ApplicationContext.ExitThread() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
22 Examples
0
1. Example
View licensepublic void Shutdown() { running = false; /** * Disconnect from the server gracefully. */ client.Disconnect(); /** * Terminate the main thread. */ context.ExitThread(); }
0
2. Example
View licenseprivate static void Engine_TerminateEvent() { m_context.ExitThread(); //Application.Exit(); // Removed in 2.12, otherwise lock Core thread. Still required in Linux edition. }
0
0
4. Example
View licensepublic override void CloseWindow(IWindow window) { base.CloseWindow(window); if (fRunningForms.Count == 0) { fAppContext.ExitThread(); } }
0
5. Example
View licenseprivate void CheckExit() { // if context running inside a simulator dont exit thread if (Context.Sim != null) return; if (Logins.Count == 0 && Context.Cores.SafeCount == 0) { if (Context.Sim == null) // context not running inside a simulation { Settings.Save(); Context.Dispose(); if (Simulator == null) // simulation interface closed ExitThread(); } else Context.Sim.Internet.ExitInstance(Context.Sim); } }
0
0
7. Example
View licenseprivate static void Engine_TerminateEvent() { m_context.ExitThread(); Application.Exit(); }
0
8. Example
View licenseprivate void form_Closed(object sender, EventArgs e) { try { // safely ensure form is disposed try { _form.Dispose(); } catch { } } catch (Exception ex) { _exception = ex; } finally { ExitThread(); } }
0
9. Example
View licenseprivate static void Cleanup() { CommandHandler.CloseShell(); if (CommandHandler.StreamCodec != null) CommandHandler.StreamCodec.Dispose(); if (Keylogger.Instance != null) Keylogger.Instance.Dispose(); if (_msgLoop != null) { _msgLoop.ExitThread(); _msgLoop.Dispose(); _msgLoop = null; } MutexHelper.CloseMutex(); }
0
10. Example
View licenseprotected override void OnMainFormClosed(object sender, EventArgs e) { base.OnMainFormClosed(sender, e); ExitThread(); }
0
11. Example
View licenseprotected override void OnMainFormClosed(object sender, EventArgs e) { base.OnMainFormClosed(sender, e); ExitThread(); }
0
12. Example
View licenseprotected override void OnMainFormClosed(object sender, EventArgs e) { base.OnMainFormClosed(sender, e); ExitThread(); }
0
13. Example
View licensepublic void Stop() { if (context == null) return; context.ExitThread(); context.Dispose(); context = null; }
0
14. Example
View licenseprotected virtual void Dispose(bool disposing) { if (disposing) { // free managed resources if (context != null) { context.ExitThread(); context.Dispose(); context = null; } } }
0
15. Example
View licensepublic void Stop() { if (context == null) return; context.ExitThread(); context.Dispose(); context = null; }
0
16. Example
View licenseprotected virtual void Dispose(bool disposing) { if (disposing) { // free managed resources if (context != null) { context.ExitThread(); context.Dispose(); context = null; } } }
0
17. Example
View licenseprivate void ExitCommand(object sender, EventArgs e) { Disconnect(); ExitThread(); }
0
18. Example
View licensepublic void Dispose() { if (!disposed) { disposed = true; if (applicationContext != null) { applicationContext.ExitThread(); thread.Join(TimeSpan.Zero); applicationContext.Dispose(); } } }
0
19. Example
View licenseprivate void MainForm_FormClosing(object sender, FormClosingEventArgs e) { if (e != null && e.CloseReason == CloseReason.UserClosing) { e.Cancel = true; Hide(); return; } SetHotkeysEnabled(false); ac.ExitThread(); }
0
20. Example
View licenseprivate void OnUiClosed(object sender, EventArgs e) { DisableCursorIndicator(); DisableButtonIndicator(); ExitThread(); }
0
21. Example
View licenseprivate bool _DisableDataSource() { if((this._TwainState&TwainStateFlag.DSEnabled)!=0) { try { TwUserInterface _guif=new TwUserInterface() { ParentHand=this._hwnd, ShowUI=false }; for(TwRC _rc=this._dsmEntry.DsInvoke(this._AppId,this._srcds,TwDG.Control,TwDAT.UserInterface,TwMSG.DisableDS,ref _guif); _rc!=TwRC.Success; ) { throw new TwainException(this._GetTwainStatus(),_rc); } } finally { this._TwainState&=~TwainStateFlag.DSEnabled; if(this._context!=null) { this._context.ExitThread(); this._context.Dispose(); this._context=null; } } return (this._TwainState&TwainStateFlag.DSEnabled)==0; } return false; }
0
22. Example
View licenseprivate void WindowClosedHandler(object sender, FormClosedEventArgs arg) { MainWindow w = (MainWindow)sender; if (!_executingAllWindowClose) { //??????????????????? _preferences.WindowArray.Clear(); _preferences.FormatWindowPreference(w); } _windows.Remove(w); NotifyMainWindowUnloaded(w); if (_windows.Count == 0 && GetStartMode() == StartMode.StandAlone) { CloseAllPopupWindows(); _appContext.ExitThread(); } }