Пример #1
0
        private static async Task showTeleprompter(TelePrompterConfig config)
        {
            var words = ReadFrom("sampleQuotes.txt");

            foreach (var word in words)
            {
                Console.Write(word);
                if (!string.IsNullOrWhiteSpace(word))
                {
                    await Task.Delay(config.DelayInMilliseconds);
                }
            }
            config.setDone();
        }
Пример #2
0
 private async Task GetInput(TelePrompterConfig config)
 {
     Action work = () =>
     {
         do
         {
             var key = Console.ReadKey(true);
             if (key.KeyChar == '>')
             {
                 config.updateDelay(-10);
             }
             else if (key.KeyChar == '<')
             {
                 config.updateDelay(10);
             }
             else if (key.KeyChar == 'X' || key.KeyChar == 'x')
             {
                 config.setDone();
             }
         } while (!config.Done);
     };
     await Task.Run(work);
 }