当前位置: 首页>>代码示例>>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;未经允许,请勿转载。