-
Notifications
You must be signed in to change notification settings - Fork 0
Home
For detailed information, go to Official documentation.
The ExtendedConsole project was created after writing many .Net console applications, and finding myself spending way too much time and effort on doing what should be, in my humble opinion, simple and trivial tasks.
Things like highlighting parts of the output text, validating and parsing user inputs, and creating simple menus - all of these tasks seems to have been, for the lack of a better term, neglected when it comes to console applications.
The ExtendedConsole project is here to provide easy-to-use solutions to these tasks.
First and foremost, it supports a super-simple xml markup for determining the foreground and background color of the text being written to the Console. No more breaking up your strings to multiple Console.Write
commands just to color a specific part of your code - using ExtendedConsole it's as simple as exConsole.WriteLine("<c b='darkRed' f='white'>This text is white on a dark red background</c>");
One more feature is the two-overloads Menu
methods - one that returns an int
indicating the user's choice, and one that simply executes an Action
based on the user's choice (and also returns the index).
Also, ever had to get an int value from the user? Your code can get quite cumbersome if any input from the user must be handled in it's loop - ExtendedConsole provides a few ReadInt
overloads, ReadBool
, a couple of ReadDateTime
, a as well as methods that you can hook up your own types for parsing user input directly - ReadClass<T>
, ReadStruct<T>
and ReadUntilConverted<T>
- for those times when you just can't let the user continue without entering a value (this method will not allow the users to escape the read loop even using ^Z
).
And the best thing about this project - it's super easy to extend. All you need to do is write extension methods, most of them can use the already existing extension methods (that's what the ReadClass<T>
and ReadStruct<T>
are there for).