private static void ExitEvent(object sender, ControlledApplicationLifetimeExitEventArgs args) { var game = AvaloniaLocator.Current.GetService <IGame>(); if (game is GameBase gameBase) { gameBase.Exit(); } }
void MainWindow_Exit(object?sender, ControlledApplicationLifetimeExitEventArgs e) { if (hasExited) { return; } hasExited = true; SettingsFile.SaveSettings(); }
void Exit(object sender, ControlledApplicationLifetimeExitEventArgs e) { var lifetime = sender as IClassicDesktopStyleApplicationLifetime; if (lifetime != null) { lifetime.Exit -= Exit; } ServiceLocator.Instance.Resolve <IJustDialService>().Dispose(); }
void OnExit(object sender, ControlledApplicationLifetimeExitEventArgs e) { if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) { var vm = (MainWindowViewModel)desktop.MainWindow?.DataContext; if (vm != null) { vm.Dispose(); } } }
private async void Desktop_Exit(object?sender, ControlledApplicationLifetimeExitEventArgs e) { if (Host is null) { return; } using (Host) { await Host.StopAsync(TimeSpan.FromSeconds(5)); } }
void OnExit(object sender, ControlledApplicationLifetimeExitEventArgs e) { Log.Information("Application shutdown"); try { AtomexApp.Stop(); } catch (Exception) { Log.Error("Error stopping Atomex in OnExit"); } }
public int Start(string[] args) { try { this.Startup?.Invoke(this, new ControlledApplicationLifetimeStartupEventArgs(args)); _cts = new CancellationTokenSource(); MainWindow?.Show(); Dispatcher.UIThread.MainLoop(_cts.Token); ControlledApplicationLifetimeExitEventArgs e = new ControlledApplicationLifetimeExitEventArgs(_exitCode); this.Exit?.Invoke(this, e); Environment.ExitCode = e.ApplicationExitCode; return(e.ApplicationExitCode); } finally { CefNetApplication.Instance.Shutdown(); } }
private void Desktop_Exit(object?sender, ControlledApplicationLifetimeExitEventArgs e) { var settings = _settingsManager.GetAppSettings(); var trackVm = Kernel.Get <DroneTrackerViewModel>(); // TODO do refactor settings.InitialPlatformLat = trackVm.InitialPlatformLatitude; settings.InitialPlatformLon = trackVm.InitialPlatformLongitude; settings.InitialPlatformAlt = trackVm.InitialPlatformAltitude; settings.InitialPlatformTilt = trackVm.InitialPlatformTilt; settings.InitialPlatformRoll = trackVm.InitialPlatformRoll; settings.InitialNorthDir = trackVm.InitialNorthDirection; settings.ZeroPTZPanAngle = trackVm.ZeroPTZPanAngle; settings.ZeroPTZTiltAngle = trackVm.ZeroPTZTiltAngle; _logger.LogInfoMessage($"App exit => app settings:\n{JsonConvert.SerializeObject(settings, Formatting.Indented)}"); _settingsManager.Save(); _ptzTransport.Teardown(); _ugcsConnection.CloseConnection(); }
private void Exit(object sender, ControlledApplicationLifetimeExitEventArgs e) { app?.Shutdown(); }
private void OnExit(object sender, ControlledApplicationLifetimeExitEventArgs e) { ShuttingDown?.Invoke(this, e); }
private static void LifetimeOnExit(object sender, ControlledApplicationLifetimeExitEventArgs e) { new ExitCommand().Execute(sender); }
void OnExit(object sender, ControlledApplicationLifetimeExitEventArgs e) { _shared.SaveConfigurations(); Lifetime.Exit -= OnExit; }
private void Exit(object sender, ControlledApplicationLifetimeExitEventArgs e) { messagePump?.Dispose(); app?.Shutdown(); }
private void onExit(object sender, ControlledApplicationLifetimeExitEventArgs args) { ServiceProvider.Dispose(); }
private void Desktop_Exit(object?sender, ControlledApplicationLifetimeExitEventArgs e) { }
private void Exit(object sender, ControlledApplicationLifetimeExitEventArgs e) { FrameworkShutdown?.Invoke(this, EventArgs.Empty); }
private void Desktop_Exit(object sender, ControlledApplicationLifetimeExitEventArgs e) { HostApplicationLifetime.StopApplication(); }
private void Desktop_Exit(object sender, ControlledApplicationLifetimeExitEventArgs e) { MessageHandlers.UnregisterMessageHandlers(this); }
private void Desktop_Exit(object sender, ControlledApplicationLifetimeExitEventArgs e) { Log.CloseAndFlush(); }
void OnExit(object sender, ControlledApplicationLifetimeExitEventArgs e) { Settings.Save(); Log.CloseAndFlush(); }
void MainWindow_Exit(object sender, ControlledApplicationLifetimeExitEventArgs e) { ApplicationHelpers.MainWindowDataContext.SaveSettings(); }