Esempio n. 1
0
        HandleCancellation(
            object sender,
            System.ConsoleCancelEventArgs e)
        {
            // allow the build to fail gracefully
            var buildManager = Core.State.BuildManager;

            if (null != buildManager)
            {
                buildManager.Cancel();
                e.Cancel = true;
            }
        }
        private static async void KeyPressHandler(object sender, System.ConsoleCancelEventArgs args)
        {
            await _logger.LogMessageAsync("\nThe read operation has been interrupted.");

            await _logger.LogMessageAsync($"  Key pressed: {args.SpecialKey}");

            await _logger.LogMessageAsync($"  Cancel property: {args.Cancel}");

            await _logger.LogMessageAsync("Setting the Cancel property to true...");

            args.Cancel = true;

            await _logger.LogMessageAsync($"  Cancel property: {args.Cancel}");

            await _logger.LogMessageAsync("The read operation will resume...\n");
        }
Esempio n. 3
0
 private static void Console_CancelKeyPress(object sender, System.ConsoleCancelEventArgs e)
 {
     Task.Run(() => bot.Stop()).Wait();
 }
Esempio n. 4
0
        } // End Function ConsoleCtrlCheck

        // Catch CTRL+C
        private static void Console_CancelKeyPress(object sender, System.ConsoleCancelEventArgs e)
        {
            OnExit();
        } // End Sub Console_CancelKeyPress
Esempio n. 5
0
 private static void Console_CancelKeyPress(object sender, System.ConsoleCancelEventArgs e)
 {
     log.Debug("Catching ctl+C keypress. Shutting down PiBot.");
     e.Cancel = true;
     s_Bot?.Shutdown();
 }
Esempio n. 6
0
 private static void Console_CancelKeyPress(object sender, System.ConsoleCancelEventArgs e)
 {
     _ = _quit.Set();
 }
Esempio n. 7
0
 private static void Console_CancelKeyPress(object sender, System.ConsoleCancelEventArgs e)
 {
     processMan.StopManager();
 }