Stop or Cancel Console.ReadLine()
I am working on a long script that uses a Background Worker but needs Console.ReadLine() to read options. In some circumnstances I need to update the console output to display a different set of options.
I tried a trick published on StackOverflow to interrupt ReadLine() but used the version that works on Windows 10 which is my OS. But after many attempts I noticed that it does NOT work in LINQPad, apparently the LINQPad Waiting for Input can be interrupted this way.
Is there a trick to interrupt "Waiting for User Input" in LINQPad v6 x64?
Comments
This should be possible: call Util.ReadLineAsync with a cancellation token.
Any example of that? didn't see it in Samples. Do note that I have a BackgroundWorker as well that is throwing data and what is read from the command line is meant to be fed to the BackgroundWorker as it is produced. Would that scheme work in LinQPad?