UPDATE: In LinqPad 5 (five), is there any way to have a timed Util.ReadLine
, that will allow me to wait for user input for X seconds, then return the default value?
Here's the synchronous code:
double mins = 0.0;
var input = Util.ReadLine("Timeout after how many minutes?", "360", new[] { "60", "120", "180", "240" });
double.TryParse(input, out mins);
I want to be to use the async version, Util.ReadLineAsync
, like this:
var input = Util
.ReadLineAsync("Timeout after how many minutes?", "360", new[] { "60", "120", "180", "240" })
.Wait(TimeSpan.FromSeconds(30));
... but the task Wait
command is a boolean return.