A NuGet package. It aim is to help you write extendable and command-based console programs in C# and .Net. https://www.craigoates.net/Software/Project/7
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Craig Oates 95d7394109 upload assembly info. to 1.0.0.2 5 years ago
Console.Waterworks upload assembly info. to 1.0.0.2 5 years ago
Documentation/GitHub_Assets [Doc Update] Updated ConsoleCommands_Flow.png 7 years ago
.gitattributes Added projects to the solution. 7 years ago
.gitignore upload assembly info. to 1.0.0.2 5 years ago
BUG_REPORT_TEMPLATE.md [Doc Update] Spelling mistakes and added links. 7 years ago
CODE_OF_CONDUCT.md [Doc-update] Added better images to doc's. 7 years ago
CONTRIBUTING.md [Doc Update] Removed "Incomplete" note. 7 years ago
LICENSE Initial commit 7 years ago
PULL_REQUEST_TEMPLATE.md [Doc-update] Added better images to doc's. 7 years ago
README.md [Doc Update] Speeling in README. 6 years ago

README.md

Logo

About Console.Waterworks

Console.Waterworks is a Nuget package. It aim is to help you write extendable and command-based console programs in C# and .Net. One of the main struggles with writing software is the need to write "plumbing code". It is the code which does not solve the main problem but it is necessary for us to reach a solution. This is why we all feel frustrated when we need to write it. It feels like we are going the long way round to that dream holiday in the sun. This is why I created Console.Waterworks. I believe we should face frustration when it finds us and only then. Why go looking for it?

Amongst other things, Console.Waterworks has this one very handy trick. It allows you to write methods which become a run-time command -- which is quite the time saver. When you use Console.Waterworks, you, also, do not need to parse end-user input. The reason why is because Console.Waterworks does it for you. This means, when people run your program, they type the method name in and your code begins excuting. On top of that, Console.Waterworks handles bad input and method parameters, as well.

Do not panic if none of what I just said made no sense. I threw a lot of information at you in a short span of time. It is okay and not unexpected. Because of this, I have prepared several images showing Console.Waterworks in action. Please feel free to check it out. It should help explain what Console.Waterwork is and how it works.

Good Input Data Flow

Example 1

Bad Input Data Flow

Example 3


Code Example - Good Input

Example 2

Code Example - Bad Input

Example 4

Disclaimer

Console.Waterworks is based on the ConsoleApplicationBase repository by TypecastException.

Pre-Requisites

To use Console.Waterworks, I recommend you meet the following pre-requisites:

Quick Start - Wiring Console.Waterworks in to your Console Program

Before continuing... I am skipping the part about creating a .Net console program. This is because I assume you know how to do that. I am, also, assuming you are using Visual Studio 2017 and C# (not VB or F#).

1 Add Console.Waterworks to your project via Nuget. You can do this using Visual Studio's (2017) Package Manager GUI. Or, you can use the Package Manager Console. Here is the command for the PM Console,

# Enter the version of number of your choice.
Install-Package Console.Waterworks -Version 0.1.0-alpha1

2 Create a class called ConsoleCommands. It can go anywhere as long as it is in the same project as the console program.

3 Make a note of the ConsoleCommands namespace.

4 Head to the Main method in Program.cs and add the following lines of code,

public static void Main(string[] args)
{
    CW_Liaison liaison = new CW_Liaison();
    liaison.Run("CW_Console", true);
}

5 Head back to ConsoleCommands and make it public and static.

6 Stay in ConsoleCommands and write the following method,

public string Test()
{
    return "Congratulations! It works.";
}

7 Run the program and type "Test" into the console.

8 If all has gone well, you should see the “Congratulations! It works." message.

9 Add more methods to you console program.

Guides

There are several guides for Console.Waterworks and in various forms. I am hopeful you will find at least one of them helpful.

Offline

I have created a guided for offline usage:

  • The Complete Guide to Console.Waterworks

This guide is printer friendly. And, it is best consumed on your favourite reading chair.

Online

For those sitting at their computer and connected to the world-wide web, there is a Wiki:

This guide aims to be a concise as possible. It assumes you are sitting at your desk and wanting the quick answer -- not the full answer.

Code of Conduct

Please visit the Code of Conduct page for Console.Waterworks at,

Contributing to the Console.Waterworks Repository

Please visit the Contributing page for Console.Waterworks at,

About the Creator

Hi, my name is Craig and I'm the creator of Console.Waterworks. Thanks for checking it out.