I would like to create a command line application in C# where users could use it as a script language. By this I mean upon the first run of the application, an instance of an object is created, and persists throughout the rest of the session. Any subsequent calls of the application from the command line use parameters set previously.
For instance if you had an application called woo.exe, which created an object called ball. Ball has a method called changeColor which accepts a string as input. Our command line call for changeColor would be.
woo changeColor red
Now if ball had a method getColor() which returned the color of the ball object, calling the command
woo getColor
Your color is red (output that comes from Console.WriteLine(“Your color is {0}”, color))
This way the user could create batch files to run methods on a single object through multiple calls of the program.
Your help is greatly appreciated.
One possible way would be:
Another possible way: