當前位置: 首頁>>代碼示例>>C#>>正文


C# System.ConsoleCancelEventArgs類代碼示例

本文整理匯總了C#中System.ConsoleCancelEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# ConsoleCancelEventArgs類的具體用法?C# ConsoleCancelEventArgs怎麽用?C# ConsoleCancelEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ConsoleCancelEventArgs類屬於System命名空間,在下文中一共展示了ConsoleCancelEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CancelKeyPressHandler

        /// <summary>
        /// Handles Ctrl+C key presses.
        /// </summary>
        private void CancelKeyPressHandler(object sender, ConsoleCancelEventArgs e)
        {
            CancellationTokenSource.Cancel();

            // Allow the application to finish cleanup rather than terminating immediately
            e.Cancel = true;
        }
開發者ID:nano-byte,項目名稱:common,代碼行數:10,代碼來源:CliTaskHandler.cs

示例2: CtrlC_Handler

 static void CtrlC_Handler(object sender, ConsoleCancelEventArgs args)
 {
     Console.WriteLine("\nCtrl-C");
     //cleanupCompleted.WaitOne();
     // prevent the process from exiting until cleanup is done:
     args.Cancel = true;
 }
開發者ID:Belxjander,項目名稱:Asuna,代碼行數:7,代碼來源:GZip.cs

示例3: Console_CancelKeyPress

 static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     System.Console.WriteLine("Cancel requested...");
     ServerEngine.Stop();
     System.Console.WriteLine("Ready to terminate");
     Thread.Sleep(100);
 }
開發者ID:timothypratley,項目名稱:Strive.NET,代碼行數:7,代碼來源:Global.cs

示例4: Console_CancelKeyPress

 static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     Log.TraceEvent(System.Diagnostics.TraceEventType.Stop, -1, "Ctrl+C received, stopping the gateway");
     e.Cancel = true;
     gateway.Dispose();
     Environment.Exit(0);
 }
開發者ID:ISISComputingGroup,項目名稱:EPICS-epicssharp,代碼行數:7,代碼來源:Program.cs

示例5: InterruptEdit

 void InterruptEdit(object sender, ConsoleCancelEventArgs a)
 {
     // Do not abort our program
     a.Cancel = true;
     // ThreadAbortException will be thrown
     _mainThread.Abort();
 }
開發者ID:mauve,項目名稱:Pash,代碼行數:7,代碼來源:SecureStringReader.cs

示例6: OnClose

        public static void OnClose(object obj,ConsoleCancelEventArgs Args)
        {
            Log.Info("Fermeture", "Fermeture du serveur");

            WorldMgr.Stop();
            Player.Stop();
        }
開發者ID:Necrosummon,項目名稱:WarEmu,代碼行數:7,代碼來源:Program.cs

示例7: Console_CancelKeyPress

 static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     e.Cancel = true;
     _s_stop = true;
     Console.Clear();
     Console.WriteLine("Closing...");
 }
開發者ID:mdxbhmt,項目名稱:taticlearn,代碼行數:7,代碼來源:Program.cs

示例8: CancelEventHandler

        protected static void CancelEventHandler(object sender, ConsoleCancelEventArgs args)
        {
            ShutdownServer();

            while (true)
                Thread.Sleep(1);
        }
開發者ID:ZettaZero,項目名稱:TeraEmulator,代碼行數:7,代碼來源:GameServer.cs

示例9: cancelStreamHandler

 private static void cancelStreamHandler(object sender, ConsoleCancelEventArgs e)
 {
     if (twitterConnection != null)
         twitterConnection.StopUserStreaming();
     ConsoleOutput.PrintMessage("All finished.", ConsoleColor.Blue);
     Thread.Sleep(TimeSpan.FromSeconds(1.3));
 }
開發者ID:nickhodge,項目名稱:BoxKite.Twitter,代碼行數:7,代碼來源:TwitterLiveFireAppAuth.cs

示例10: Console_CancelKeyPress

 static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     if (e.SpecialKey == ConsoleSpecialKey.ControlC)
     {
         Shutdown();
     }
 }
開發者ID:ExpTeam,項目名稱:trunk,代碼行數:7,代碼來源:Program.cs

示例11: CancelKeyPressed

        private void CancelKeyPressed(object sender, ConsoleCancelEventArgs e)
        {
            console.WriteEmptyLine();
            console.WriteLine("Ctrl + C hit. Shutting down.");

            Environment.Exit(-1);
        }
開發者ID:gentisaliu,項目名稱:webservice-examples,代碼行數:7,代碼來源:ApplicationRuntime.cs

示例12: Console_CancelKeyPress

		private static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
		{
			e.Cancel=true;
			ConsoleColor color=Console.ForegroundColor;
			Console.ForegroundColor=ConsoleColor.Cyan;
			Console.WriteLine("Please input to close server.");
			Console.ForegroundColor=color;
		}
開發者ID:247321453,項目名稱:YgoServer,代碼行數:8,代碼來源:Program.cs

示例13: Cancel

 private void Cancel(object sender, ConsoleCancelEventArgs e)
 {
     Console.WriteLine("(Ctrl + C)");
     e.Cancel = true;
     stopRead = true;
     mainThread.Join();
     Environment.Exit(0);
 }
開發者ID:KorniltsevMikhail,項目名稱:testTask,代碼行數:8,代碼來源:Worker.cs

示例14: Console_CancelKeyPress

 private static void Console_CancelKeyPress(Object sender, ConsoleCancelEventArgs e)
 {
     lock (SyncObject)
     {
         running = false;
     }
     e.Cancel = true;
 }
開發者ID:tlgkccampbell,項目名稱:ultraviolet-build,代碼行數:8,代碼來源:Program.cs

示例15: ConsoleCancelKeyPress

        private void ConsoleCancelKeyPress(object sender, ConsoleCancelEventArgs e)
        {
            e.Cancel = true;

            Console.WriteLine();
            Console.WriteLine("Please use '#q' to quit the loop.");
            Console.Write(">");
        }
開發者ID:automagic,項目名稱:poshgit2,代碼行數:8,代碼來源:RepoCacheTestLoop.cs


注:本文中的System.ConsoleCancelEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。