Beispiel #1
0
        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();
 }
Beispiel #3
0
        void Exit(object sender, ControlledApplicationLifetimeExitEventArgs e)
        {
            var lifetime = sender as IClassicDesktopStyleApplicationLifetime;

            if (lifetime != null)
            {
                lifetime.Exit -= Exit;
            }

            ServiceLocator.Instance.Resolve <IJustDialService>().Dispose();
        }
Beispiel #4
0
 void OnExit(object sender, ControlledApplicationLifetimeExitEventArgs e)
 {
     if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
     {
         var vm = (MainWindowViewModel)desktop.MainWindow?.DataContext;
         if (vm != null)
         {
             vm.Dispose();
         }
     }
 }
Beispiel #5
0
        private async void Desktop_Exit(object?sender, ControlledApplicationLifetimeExitEventArgs e)
        {
            if (Host is null)
            {
                return;
            }

            using (Host)
            {
                await Host.StopAsync(TimeSpan.FromSeconds(5));
            }
        }
Beispiel #6
0
 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();
            }
        }
Beispiel #8
0
        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();
        }
Beispiel #9
0
 private void Exit(object sender, ControlledApplicationLifetimeExitEventArgs e)
 {
     app?.Shutdown();
 }
Beispiel #10
0
 private void OnExit(object sender, ControlledApplicationLifetimeExitEventArgs e)
 {
     ShuttingDown?.Invoke(this, e);
 }
Beispiel #11
0
 private static void LifetimeOnExit(object sender, ControlledApplicationLifetimeExitEventArgs e)
 {
     new ExitCommand().Execute(sender);
 }
Beispiel #12
0
 void OnExit(object sender, ControlledApplicationLifetimeExitEventArgs e)
 {
     _shared.SaveConfigurations();
     Lifetime.Exit -= OnExit;
 }
Beispiel #13
0
 private void Exit(object sender, ControlledApplicationLifetimeExitEventArgs e)
 {
     messagePump?.Dispose();
     app?.Shutdown();
 }
Beispiel #14
0
 private void onExit(object sender, ControlledApplicationLifetimeExitEventArgs args)
 {
     ServiceProvider.Dispose();
 }
Beispiel #15
0
 private void Desktop_Exit(object?sender, ControlledApplicationLifetimeExitEventArgs e)
 {
 }
Beispiel #16
0
 private void Exit(object sender, ControlledApplicationLifetimeExitEventArgs e)
 {
     FrameworkShutdown?.Invoke(this, EventArgs.Empty);
 }
 private void Desktop_Exit(object sender, ControlledApplicationLifetimeExitEventArgs e)
 {
     HostApplicationLifetime.StopApplication();
 }
Beispiel #18
0
 private void Desktop_Exit(object sender, ControlledApplicationLifetimeExitEventArgs e)
 {
     MessageHandlers.UnregisterMessageHandlers(this);
 }
Beispiel #19
0
 private void Desktop_Exit(object sender, ControlledApplicationLifetimeExitEventArgs e)
 {
     Log.CloseAndFlush();
 }
Beispiel #20
0
 void OnExit(object sender, ControlledApplicationLifetimeExitEventArgs e)
 {
     Settings.Save();
     Log.CloseAndFlush();
 }
Beispiel #21
0
 void MainWindow_Exit(object sender, ControlledApplicationLifetimeExitEventArgs e)
 {
     ApplicationHelpers.MainWindowDataContext.SaveSettings();
 }