8 CW Console Project Breakdown
Craig Oates edited this page 4 years ago

cw-console selected project

This project is a traditional .Net 4.7 console program, written in C#. Within it, you will find one folder and six files. Having said that, you will spend most of your time in one file, called "ConsoleCommands.cs". This is after you have grasped what is happening in  "Program.cs", though.

The following files are standard C# files in a Visual Studio (console) project:

With these files being standard files, in a typical C# project, I will not spend any time of them. What I will do instead is focus on the project specific files. If you are more interested with jumping straight into the code, start at "Program.cs". then move onto "ConsoleCommands.cs".

The links for these files are as follows:

cw-console file structure

"Program.cs" is the entry point into the system -- it is where Main resides. The purpose of Main in this context is to set-up in "input-loop", using Console.Waterworks. Once you have grasped what/how it is doing that, you should never need to go back in this folder.

"ConsoleCommands.cs" houses the all the command-methods. The methods you write in here are what the end-user will need to type into the console to execute said methods. It is important to note the end-user must match the command-method name exactly. For example, if you name one of your command-methods Request-Data, the end-user must enter "Request-Data" into the console -- "requestdata" and "request-data" will not work.

As an aside, "Command-method" is a term specific to this project. They are regular methods which live in "ConsoleCommands.cs". I call them that to help differentiate them from other methods throughout the system. Feel free to ignore this term or call them whatever makes sense to you.

More information about command-methods is available at the following links: