src/VirtualAutoClicker/Program.cs
/// <summary>
/// Starts all handlers ensuring that the application closes the running autoclicker before exiting.
/// </summary>
Starts all handlers ensuring that the application closes the running autoclicker before exiting.
Starts all handlers ensuring that the application closes the running autoclicker before exiting .
private static void StartClosingHandlers()
        {
            Console.CancelKeyPress += (sender, e) =>
            {
                ConsoleHelper.WriteWarning("Application closing, running clean up!");
                e.Cancel = true;
                VacEnvironment.GetAcWorker()?.Picnic();
                VacEnvironment.Close();
                Environment.Exit(0);
            };
            AppDomain.CurrentDomain.ProcessExit += (sender, e) => VacEnvironment.GetAcWorker()?.Picnic();
        }
private static void StartClosingHandlers ( ) { Console . CancelKeyPress += ( sender , e ) => { ConsoleHelper . WriteWarning ( " " ) ; e . Cancel = true ; VacEnvironment . GetAcWorker ( ) ? . Picnic ( ) ; VacEnvironment . Close ( ) ; Environment . Exit ( 0 ) ; } ; AppDomain . CurrentDomain . ProcessExit += ( sender , e ) => VacEnvironment . GetAcWorker ( ) ? . Picnic ( ) ; }
Starts all handlers ensuring that the application closes the running autoclicker before exiting.
Starts all handlers ensuring that the application closes the running autoclicker before exiting .