private static 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); }
public void SetDone_SetsDoneToTrue() { var config = new TeleprompterConfig(); config.SetDone(); Assert.True(config.Done); }
static async Task ShowTeleprompter(TeleprompterConfig config) { var lines = ReadFile(fileNameConst); foreach (var line in lines) { Console.Write(line); if (!string.IsNullOrWhiteSpace(line)) { await Task.Delay(config.DelayInMiliseconds); } } config.SetDone(); }
private static async Task ShowTeleprompter(TeleprompterConfig config) { var words = ReadFrom("/Users/kernel_panic/sampleQuotes.txt"); foreach (var word in words) { Console.Write(word); if (!string.IsNullOrWhiteSpace(word)) { await Task.Delay(config.DelayInMilliseconds); } } config.SetDone(); }