Home General

Get run values at start from the user

edited February 19 in General

Hi, maybe someone has made a clever solution for this.
I have A LOT of everyday-scripts that do things and many of then have a few configuration rows at the top and I need to uncomment the one needed for this specific run. Most common is "what environment would you like to use: dev, stg, acc, prd".
Is there a way to have some kind of GUI for this, when I press RUN I would like a small dialog to show up that let me select a predefined value. Or something in linqpad itself, like when you select the Data-connection from the combo.

The two solutions I've come up with is
1. Use "Util.ReadLine" and then the user writes "dev"
2. I'm on windows so I've tried just to make a simple Windows form to show with buttons, one button for every environment... and yes... it works.. but it feels trashy and also it is very slow, not sure what is going on there, the first run takes a few seconds to load the form stuff... I guess.

Would be super nice to have like just a simple
var env = Util.GetComboChoice("what evironment?", "dev,sys,stg,prd")

Anyone has any ideas how to collect configuration values from the user?
:-)

Comments

Sign In or Register to comment.