ConsoleMenuDN 0.0.7
See the version list below for details.
dotnet add package ConsoleMenuDN --version 0.0.7
NuGet\Install-Package ConsoleMenuDN -Version 0.0.7
<PackageReference Include="ConsoleMenuDN" Version="0.0.7" />
<PackageVersion Include="ConsoleMenuDN" Version="0.0.7" />
<PackageReference Include="ConsoleMenuDN" />
paket add ConsoleMenuDN --version 0.0.7
#r "nuget: ConsoleMenuDN, 0.0.7"
#:package ConsoleMenuDN@0.0.7
#addin nuget:?package=ConsoleMenuDN&version=0.0.7
#tool nuget:?package=ConsoleMenuDN&version=0.0.7
ConsoleMenuDN
ConsoleMenuDN is a helper library for creating interactive menus within console applications. This library simplifies the process of building and managing console-based menus, making it easier to create user-friendly command-line interfaces.
Features
- Easy-to-use API for creating console menus.
- Support for asynchronous menu actions.
- Automatic handling of key inputs (navigation, selection).
- Responsive to console window resize events.
Installation
You can install the ConsoleMenuDN package via NuGet:
dotnet add package ConsoleMenuDN
Usage
Basic Example
Here's a simple example of how to use ConsoleMenuDN to create a console menu:
using ConsoleMenuDN;
class Program
{
static async Task Main(string[] args)
{
var menuOptions = new List<MenuOption>
{
new MenuOption("Option 1", async () => await Task.Run(() => Console.WriteLine("Option 1 selected"))),
new MenuOption("Option 2", async () => await Task.Run(() => Console.WriteLine("Option 2 selected"))),
new MenuOption("Exit", async () => Environment.Exit(0))
};
var menu = new MenuManager(menuOptions, "Main Menu");
menu.Show();
}
}
Creating Menu Options
Menu options can be created by instantiating the MenuOption class. Each option requires a name and an action to perform when selected:
var option = new MenuOption("Option 1", async () => await Task.Run(() => Console.WriteLine("Option 1 selected")));
Displaying the Menu
To display the menu, create an instance of MenuManager and call the Show method:
var menu = new MenuManager(menuOptions, "Main Menu");
menu.Show();
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
License
This project is licensed under the MIT License. See the LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- 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 |
|---|---|---|
| 0.1.6 | 245 | 6/23/2024 |
| 0.1.5 | 150 | 6/23/2024 |
| 0.1.4 | 177 | 6/19/2024 |
| 0.1.3 | 179 | 6/19/2024 |
| 0.1.2 | 177 | 6/19/2024 |
| 0.1.1 | 159 | 6/19/2024 |
| 0.0.8 | 156 | 6/19/2024 |
| 0.0.7 | 156 | 6/19/2024 |
| 0.0.6 | 142 | 6/19/2024 |
| 0.0.5 | 163 | 6/19/2024 |
| 0.0.4 | 172 | 6/19/2024 |
| 0.0.3 | 174 | 6/19/2024 |
| 0.0.2 | 163 | 6/19/2024 |
| 0.0.1 | 162 | 6/19/2024 |