Simple library built on .NET standard to create a console menu interface
- Asynchronous/synchronous function
- Possibility of making unlimited Sub-Pages
- Return and navigation header
- Configurable options
- It is extremely easy-to-use
// BreadCrumbHeader (boolean - default: false) = Enable/disable display of navigation between pages// UserInputMessage (string - default: "Choose your option") = The message that the user will be prompted to type the optionusingEasyMenu;usingEasyMenu.Models;MenuBuilderMenuSettings=newMenuBuilder(BreadCrumbHeader:true,UserInputMessage:"Choose:")// You can add lambda expressions.WithMenu("Page A",()=>{Console.WriteLine("Hi from Page A!");})// or.. directly call an (a)synchronous method.WithMenu("Page B",MyMethod)// or.. make a sub pages.WithMenu("Page C",new[]{// Inside you can do exactly the same as in .WithMenunewMenu("SubPage A",()=>{Console.WriteLine("Hi from SubPage A!");}),// Also you can create all the SubPages you want within othersnewMenu("SubPage B",new[]{newMenu("SubPage BA",()=>{Console.WriteLine("Hi from SubPage BA!");}),newMenu("SubPage BB",()=>{Console.WriteLine("Hi from SubPage BB!");}),// (...)})});// e.g. Page > Page2 > Page3MenuSettings.HeadNavigationSeparator=">";// Optional// Page > Page2 > Page3// --- <- this// 1. (...)MenuSettings.HeadNavigationMenuSeparator="---";// Optional// The error message inputMenuSettings.ErrorUserInput="Invalid Input!";// Optional// Build to MenuConsoleMenuConsoleconsoleMenu=MenuSettings.Build();// Display menu - UpdateConsole (Optional): Refresh the console after there is an errorconsoleMenu.Show(UpdateConsole:true);staticvoidMyMethod(){Console.WriteLine("Hi from MyMethod!");}If you find a problem or have a suggestion inside this library, please let me know by clicking here, if you want to improve the code, make it cleaner or more secure, create a pull request.
In case you will contribute in the code, please follow the same code base
Telegram: https://t.me/biitezBitcoin Addy: bc1qzz4rghmt6zg0wl6shzaekd59af5znqhr3nxmms
