Example #1
0
    private static void OnCancelKey(ConsoleCancelEventArgs ev, RubyContext context, Thread mainThread) {
        if (ev.SpecialKey == ConsoleSpecialKey.ControlC) {
            ev.Cancel = true;
            Action handler = context.InterruptSignalHandler;

            if (handler != null) {
                try {
                    handler();
                } catch (Exception e) {
                    RubyUtils.RaiseAsyncException(mainThread, e);
                }
            }
        }
    }
Example #2
0
 private static void OnCancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     Exit();
 }
 private static void OnExit(object sender, ConsoleCancelEventArgs args)
 {
     Closing.Set();
 }
Example #4
0
 protected void AbortHandler(object sender, ConsoleCancelEventArgs args)
 {
     DisplayStats();
 }
Example #5
0
 static void interrupt_handler(object sender, ConsoleCancelEventArgs e)
 {
     quit = true; e.Cancel = true;
 }
Example #6
0
 private static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     _socketListener.Shutdown(SocketShutdown.Both);
     _socketListener.Close(1000);
 }
Example #7
0
 static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     Console.WriteLine("Exiting...");
     Environment.Exit(0);
 }
Example #8
0
 static void AbortHandler(object sender, ConsoleCancelEventArgs args)
 {
     DisplayStats();
 }
Example #9
0
 private static void CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     e.Cancel = true;
 }
Example #10
0
 protected static void myHandler(object sender, ConsoleCancelEventArgs args)
 {
     server.Shutdown();
     args.Cancel = true;
 }
Example #11
0
 private static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     logger.Warn("Terminating...");
     e.Cancel = true;
     token.Cancel();
 }
Example #12
0
 public static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     Console.WriteLine("Now CTRL+C is used as the cancel key");
     Console.ReadLine();
     e.Cancel = true;
 }
Example #13
0
 private void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     RunShutdownTasks();
 }
Example #14
0
 private void OnConsoleCancelKeyPress(object sender, ConsoleCancelEventArgs e) => Stop();
Example #15
0
 private void OnExit(object sender, ConsoleCancelEventArgs args)
 {
     CancelEventSourceListeners();
 }
Example #16
0
 static void AbortHandler(object sender, ConsoleCancelEventArgs args)
 {
     DisplayIterationStats();
     Console.Error.WriteLine("memory {0}", Memory.Usage);
 }
Example #17
0
 void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     if (e.SpecialKey == ConsoleSpecialKey.ControlC)
     {
         e.Cancel = true;
         ctrlCEvent.Set();
         MainEngineThread.Abort(new PythonKeyboardInterruptException(""));
     }
 }
Example #18
0
 private void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     _agentWriter.FlushAndCloseAsync().Wait();
 }
Example #19
0
	protected static void exit_handler(object sender, ConsoleCancelEventArgs args)
	{
		args.Cancel = true;
	}
Example #20
0
 private static void CancelKeyPressed(object sender, ConsoleCancelEventArgs e)
 {
     e.Cancel        = true;
     continueRunning = false;
 }
Example #21
0
 protected static void CloseConsole(object sender, ConsoleCancelEventArgs e)
 {
     Environment.Exit(0);
 }
Example #22
0
 private void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     Debug.Log("Exit");
 }
Example #23
0
 private static void ConsoleOnCancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     cancellationTokenSource.Cancel();
 }
Example #24
0
 private static void ConsoleOnCancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     Log.Warning("Canceling process");
     e.Cancel = true;
     ExitEvent.Set();
 }
Example #25
0
 private static void CancelKeyHandler(object sender, ConsoleCancelEventArgs args)
 {
     // Handle process exiting ourself.
     args.Cancel = true;
     IoCManager.Resolve <IBaseServer>().Shutdown();
 }
Example #26
0
 // Add a reference to this class in the event handler arguments
 private static void CancelHandlerEx(object s, ConsoleCancelEventArgs e)
 {
     CancelHandler(e);
 }
Example #27
0
 static void consoleCancelHandle(object sender, ConsoleCancelEventArgs e)
 {
     Console.WriteLine("Aguarde o término das requisições.");
     cancel = true;
 }
Example #28
0
 private void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     _shouldClose = true;
 }
Example #29
0
 // Notice the special work for handling Ctrl+C pressed (i.e copy selection to clipboard)
 void On_Ctrl_C_Pressed(object sender, ConsoleCancelEventArgs args)
 {
     KeyHandlerCtrl.HandleCtrlCPressed(m_CurrentState);
 }
Example #30
0
 private void ConsoleCancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     _tokenSource.Cancel();
 }
Example #31
0
 /// <summary>
 /// Executed if user interrups the program (i.e. CTRL+C)
 /// </summary>
 static void CancelKeyPressHandler(object sender, ConsoleCancelEventArgs args)
 {
     log.Info("Application interrupted by user");
     CleanUp();
     Environment.Exit(0);
 }
Example #32
0
 private static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     e.Cancel = true;
     _tokenSource.Cancel();
 }
Example #33
0
 static void Shutdown(object sender, ConsoleCancelEventArgs e)
 {
     Console.WriteLine("Closing HttpListener");
     listener.Close();
     Environment.Exit(0);
 }
Example #34
0
 static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
 }
Example #35
0
 public static void CancelHandler(object sender, ConsoleCancelEventArgs args)
 {
     UpdateManager.Instance.Abort(true);
     Environment.Exit(2);
 }
Example #36
0
 public static void Stop(object sender, ConsoleCancelEventArgs e)
 {
     Console.WriteLine("Cancelling......");
     heartbeatTimer.Stop();
     heartbeatTimer.Dispose();
 }
Example #37
0
    protected virtual void ConsoleInterrupt(object sender, ConsoleCancelEventArgs a)
    {
        // Do not about our program
        a.Cancel = true;

        evaluator.Interrupt ();
    }
 private void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     Exit = true;
 }
 static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     var end = DateTime.Now;
     Console.WriteLine("This program ran for {0:000.000} seconds.", (end - start).TotalMilliseconds / 1000);
     Environment.Exit(0);
 }
Example #40
0
 static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     // We don't actually want to do anything here.  This will only get called on the off chance
     // that someone CTRL+C's the test run while the handler is hooked up.  This is just used to 
     // validate that we can add and remove a handler, we don't care about exercising it.
 }