Ejemplo 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;
            }
        }
Ejemplo n.º 2
0
        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");
        }
Ejemplo n.º 3
0
 private static void Console_CancelKeyPress(object sender, System.ConsoleCancelEventArgs e)
 {
     Task.Run(() => bot.Stop()).Wait();
 }
Ejemplo n.º 4
0
        } // End Function ConsoleCtrlCheck

        // Catch CTRL+C
        private static void Console_CancelKeyPress(object sender, System.ConsoleCancelEventArgs e)
        {
            OnExit();
        } // End Sub Console_CancelKeyPress
Ejemplo 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();
 }
Ejemplo n.º 6
0
 private static void Console_CancelKeyPress(object sender, System.ConsoleCancelEventArgs e)
 {
     _ = _quit.Set();
 }
Ejemplo n.º 7
0
 private static void Console_CancelKeyPress(object sender, System.ConsoleCancelEventArgs e)
 {
     processMan.StopManager();
 }