예제 #1
0
        /// <summary>
        /// Cancel the currently active scanner.
        /// </summary>

        public void Cancel()
        {
            lock (sync)
            {
                if (scanner != null)
                {
                    scanner.Cancel();
                }
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: Dr1N/FileScanner
 static void WaitUserInput(IScanner scanner)
 {
     PrintMessage("Processing (to cancel or exit press [Esc])...", ConsoleColor.Green);
     while (true)
     {
         var keyInfo = Console.ReadKey(true);
         if (keyInfo.Key == ConsoleKey.Escape)
         {
             scanner?.Cancel();
             break;
         }
     }
 }