コード例 #1
0
        private static void Run()
        {
            Console.CancelKeyPress += new ConsoleCancelEventHandler(Console_CancelKeyPress);
            Console.WriteLine("Press 'X' to quit");

            ImportService.startSync();
            while (true)
            {
                if (Console.ReadKey(true).Key == ConsoleKey.X)
                {
                    Console_CancelKeyPress(null, null);
                    break;
                }
                ;
            }
        }
コード例 #2
0
 static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     ImportService.stopSync();
     Console.WriteLine("Sync Stop");
 }