示例#1
0
 private void Interrupt()
 {
     if (_interruptable == null)
     {
         return;
     }
     _interruptable.Interrupt();
     ResumeFromOpeningSession();
 }
 internal void Interrupt()
 {
     if (interruptStack.Count > 0)
     {
         IInterruptable toInterrupt = interruptStack.Peek();
         toInterrupt.Interrupt();
     }
     else
     {
         if (application is ShellApplication)
         {
             ((ShellApplication)application).OnInterrupt();
         }
         System.Console.Error.WriteLine("[Ctrl-C ; interrupted]");
         Environment.Exit(1);
     }
 }
示例#3
0
        protected override void OnSignal()
        {
            if (once)
            {
                // got the interrupt more than once. May happen if you press
                // Ctrl-C multiple times .. or with broken thread lib on Linux.
                return;
            }

            once = true;
            if (interruptStack.Count > 0)
            {
                IInterruptable toInterrupt = (IInterruptable)interruptStack.Peek();
                toInterrupt.Interrupt();
            }
            else
            {
                System.Console.Error.WriteLine("[Ctrl-C ; interrupted]");
                Environment.Exit(1);
            }
        }
示例#4
0
 private void InterruptConnecting()
 {
     _connector.Interrupt();
 }