private void _systemEvents_SessionLogoff(object sender, EventArgs e) { if (!_appHost.IsRunningAsService) { _appHost.Shutdown(); } }
/// <summary> /// Posts the specified request. /// </summary> /// <param name="request">The request.</param> public void Post(ShutdownApplication request) { Task.Run(async() => { await Task.Delay(100).ConfigureAwait(false); await _appHost.Shutdown().ConfigureAwait(false); }); }
/// <summary> /// Posts the specified request. /// </summary> /// <param name="request">The request.</param> public void Post(ShutdownApplication request) { Task.Run(async() => { await Task.Delay(100); _appHost.Shutdown(); }); }
public ActionResult ShutdownApplication() { Task.Run(async() => { await Task.Delay(100).ConfigureAwait(false); await _appHost.Shutdown().ConfigureAwait(false); }); return(NoContent()); }
void cmdExit_Click(object sender, EventArgs e) { _appHost.Shutdown(); }
private void _systemEvents_SystemShutdown(object sender, EventArgs e) { _appHost.Shutdown(); }
/// <summary> /// Handles the click event of the cmExit control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param> private async void cmExit_click(object sender, RoutedEventArgs e) { await _appHost.Shutdown().ConfigureAwait(false); }