Esempio n. 1
0
        /// <summary>
        /// Cancel the currently active scanner.
        /// </summary>

        public void Cancel()
        {
            lock (sync)
            {
                if (scanner != null)
                {
                    scanner.Cancel();
                }
            }
        }
Esempio n. 2
0
 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;
         }
     }
 }