EasyMenu 1.0.2

dotnet add package EasyMenu --version 1.0.2                
NuGet\Install-Package EasyMenu -Version 1.0.2                
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.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasyMenu --version 1.0.2                
#r "nuget: EasyMenu, 1.0.2"                
#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.2

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

EasyMenu

Nuget GitHub Latest Release

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:
MenuBuilder MenuSettings = new MenuBuilder(BreadCrumbHeader: true, UserInputMessage: "Choose:")

    // 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 with SubSubMenus", new[]
        {
            new Menu("SubSubMenu BA", () => { Console.WriteLine("Hi from SubSubMenu BA!"); }),
            new Menu("SubSubMenu BB", () => { Console.WriteLine("Hi from SubSubMenu BB!"); }),
        })
    });

// e.g. Page > Page2 > Page3
MenuSettings.HeadNavigationSeparator = ">";

// Page > Page2 > Page3
// --- <- this
// [1] (...)
MenuSettings.HeadNavigationMenuSeparator = "---";

// The error message input
MenuSettings.ErrorUserInput = "Invalid Input!";

// Build to MenuConsole
MenuConsole consoleMenu = MenuSettings.Build();

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

static 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