Well, you have to build your own "transducer". Basically, in your main, you can just have a switch
statement and a Console.ReadLine()
. When the user runs your executable you can output something like Enter Command:
and wait for the users input. Then just capture the users input and switch on it.
class Program
{
static void Main(string[] args)
{
string cmd = Console.ReadLine();
switch(cmd)
{
case "DoStuff":
someClass.DoStuff();
break;
case "DoThis":
otherClass.DoThis();
break;
}
}
}
And if you want to continue receiving input commands from the user then just wrap something like that in a while loop and when the user wants to Quit
break out of the loop and terminate the program.