EasyMenu 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package EasyMenu --version 1.0.0                
NuGet\Install-Package EasyMenu -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EasyMenu" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasyMenu --version 1.0.0                
#r "nuget: EasyMenu, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EasyMenu as a Cake Addin
#addin nuget:?package=EasyMenu&version=1.0.0

// Install EasyMenu as a Cake Tool
#tool nuget:?package=EasyMenu&version=1.0.0                

EasyMenu

Library created in .NET Standard to make menus in C# console in a very simple way

Features:
  • Menus with asynchronous/synchronous function
  • Possibility of making unlimited Sub-Menus
  • Return and navigation header
  • Configurable options
Preview:

Preview Gif

Example:
MenuConsole Menu = new MenuBuilder(BreadCrumbHeader: true, UserInputMessage: "Choose:", PageNavigationSeparator: "-")

    // You can add lambda expressions
    .WithMenu("Menu A", () => { Console.WriteLine("Hi from Menu A!"); } )

    // or.. directly call an (a)synchronous method
    .WithMenu("Menu MyMethod", MyMethod )

    // o.. make subMenus
    .WithMenu("Menu with SubMenus", new[]
    {
        // Dentro de los SubMenus puede hacer exactamente lo mismo que en .WithMenu
        new Menu("SubMenu A", () => { Console.WriteLine("Hi from SubMenu A!"); }),

        // Also you can create all the SubMenus you want within others
        new Menu("SubMenu B", new[]
        {
            new Menu("SubSubMenu BA", () => { Console.WriteLine("Hi from SubSubMenu BA!"); }),
            new Menu("SubSubMenu BB", () => { Console.WriteLine("Hi from SubSubMenu BB!"); }),
        })
    }, false)
    // If the user does not enter a numerical option by calling one of the Menus, this error message will appear
    .WithCustomErrorMessageInvalidInput("Invalid Input!")
    .Build();

// Display menu - UpdateConsole: Refresh the console after there is an error
Menu.Show(UpdateConsole: true);

void MyMethod()
{
    Console.WriteLine("Hi from MyMethod!");
}

Contributions, reports or suggestions

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

Credits

  • Telegram: https://t.me/biitez
  • Bitcoin Addy: bc1qzz4rghmt6zg0wl6shzaekd59af5znqhr3nxmms
Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 360 12/28/2021
1.0.0 265 12/28/2021