I am wondering whether there are libraries in .NET that make it easy to write console user interfaces. For instance, imagine a WinForms application, where the user can:
And the application in return displays several lines of text.
It can be shown, that the GUI in such an application can be mapped to the respective CUI without any problem.
So, if one has to stick to console, then are there any .NET tools to let write such CUI easily?
EDIT1
Let me define a constraint, which should help folks to grasp the idea of CUI. Imagine a machine, to which you can open a remote console, but not RDS. So, running a GUI application remotely on that machine is out of the question, because it will be unable to open any window. However, it is possible to have a remote console, leaving us with two possible flavors of CUI:
The first options allows to place characters at arbitrary positions on the console window. ncurses is the low level library for *nix systems that allows to do such things. A CUI created in such a way can be pretty expressive and convenient, but for the sake of our discussion let me rule this option out as well, because a remote console is unlikely to support the ability to move around the console window.
So, this leaves us with the text based CUI, the one created by means of printf
and scanf only (and the likes).
EDIT2
Another clarification: I mention Windows Forms in the question as an example of simple User Interface, which has nothing special that could not be translated to text based console UI. This is only to illustrate that simple GUI elements like menus and modal dialogues can be modeled in console without resorting to windows.
Exit() method to exit a console application in C#. The Environment. Exit() method is used to end the execution of a console application in C#.
Console user interface may refer to: Command-line interface, user interface using only text. Text-based user interface, user interface with simple text-based menus and dialogues.
The console is an operating system window where users interact with the operating system or with a text-based console application by entering text input through the computer keyboard, and by reading text output from the computer terminal.
If you do not know what I am talking about: press Win+R, type “help” and press ENTER. A black console window will open, execute the HELP command and close again. Often, this is not desired. Instead, the command should execute without any visible window.
Have a look at consolemenuui.codeplex.com. Other than menus (plus Yes-No dialogs and value prompts which should be easy to implement), I could hardly imagine other possible prompt-based controls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With