To help you get up to speed with how CW-Console works, please conside the image below.
The way it works is as follows:
- The console recieves a command from the end-user;
- Console.Waterworks (C.W.) parses the command and matches it with the corresponding command-method (in "ConsoleCommands.cs"). After that;
- The command-method runs and returns the result it has computered.
That's the "happy path" version at least. If the end-user enters an invalid command, C.W. will return an error message.
For C.W. to operate as designed, it needs to rely on certain things, which are;
- C.W. controls the "input-loop" from
Main
, in "Program.cs". - The
ConsoleCommands
class must live in a name-space within the (console) project. - The command-methods within
ConsoleCommands
are marked aspublic
andstatic
.
If you are new to the project, I recommend you take a moment to look at the code in "Program.cs" and "ConsoleCommand.cs". Once you have a good grasp of what it happening in "Program.cs", you should not need to look at it again. That is when you can start to focus on the code in "ConsoleCommands.cs" -- the place where most of the work is. The links for these files are as follows: