LINQPad.Controls pause for input
I'm trying out the new LINQPad.Controls and want to dump some radio buttons and then wait for user input before continuing with the rest of the query. What's the best approach for pausing the code here?
For example here's a simple first approach, but are there better alternatives?
John
For example here's a simple first approach, but are there better alternatives?
void Main() { var radioOne = new RadioButton("group1", "One").Dump(); var radioTwo = new RadioButton("group1", "Two").Dump(); var radioThree = new RadioButton("group1", "Three").Dump(); var btnRun = new Button("Run").Dump(); btnRun.Click += (sender, args) => { if (radioOne.Checked) { DoSomething("One"); } if (radioTwo.Checked) { DoSomething("Two"); } if (radioThree.Checked) { DoSomething("Three"); } }; } private void DoSomething(string cmd) { cmd.Dump(); }Many thanks
John
Comments
Hi,
I'm a relatively inexperienced LINQPader... hit an issue trying to implement this.
I get an error (even after adding in the Namespace stuff)
"CS0305 Using the generic type 'TaskCompletionSource' requires 1 type arguments"
Tried to figure it out consulting the MS documentation, seems I need to add a type... but am out of my depth.
Is there an update that shows how to do this with a type ?
Or is there a better way? I just want a button I can click (maybe inside a loop ?) that will then run my query using some user-input parameters. This post seemed real close to providing a mechanism to do that.
BTW... I am running this in LINQPad 5. Will it be any different under LP 6?
Thanks,
There was an issue with the markdown editor removing anything in angle brackets. It should be fixed now. The line in question should read:
Thanks Joe... all good now.