CDS.CLIMenus
2.0.2
See the version list below for details.
dotnet add package CDS.CLIMenus --version 2.0.2
NuGet\Install-Package CDS.CLIMenus -Version 2.0.2
<PackageReference Include="CDS.CLIMenus" Version="2.0.2" />
<PackageVersion Include="CDS.CLIMenus" Version="2.0.2" />
<PackageReference Include="CDS.CLIMenus" />
paket add CDS.CLIMenus --version 2.0.2
#r "nuget: CDS.CLIMenus, 2.0.2"
#addin nuget:?package=CDS.CLIMenus&version=2.0.2
#tool nuget:?package=CDS.CLIMenus&version=2.0.2
CDS.CLIMenus
CDS.CLIMenus is a library for creating very simple and quick console-app menus. It is great for simple demo and test applications.
It's available for .Net 8 and .Net Framework 4.8 console applications.
It will only save you 10-20 minutes of coding, but that leaves more time for the fun stuff!
In this release there is only a basic menu system, in the Basic
namespace. Future
release will include more advanced features.
Correction: this release prompts the user to hit any key after running the menu action. This feature was meant to be in the original release, but was accidentally left out!
Usage
Fluent API for Building Menus
The following example demonstrates how to use the fluent API to build and run a menu:
using CDS.CLIMenus.Basic;
using ConsoleDemo;
new MenuBuilder("Main menu")
.AddItem("Generate Prime Numbers", new PrimeNumberGenerator().Run)
.AddItem("Play High-Low Game", "Try to guess the number I'm thinking of!", new HighLowGame().Run)
.Build()
.Run();
Conventional API for Building Menus
Alternatively, you can use the conventional API to build and run a menu:
using .Basic;
using ConsoleDemo;
var menuItems = new List<MenuItem>
{
new("Generate Prime Numbers", () => new PrimeNumberGenerator().Run()),
new("Play High-Low Game", "Try to guess the number I'm thinking of!", () => new HighLowGame().Run())
};
var menu = new Menu("Main Menu", menuItems);
menu.Run();
Build Instructions
Follow the standard practice for building a .Net project using Nerdbank.GitVersioning. The version.json file is automatically updated with the new version number, or can be manually updated for a major or minor version change.
License
This project is licensed under the MIT License.
Attributions
Number package icon, created by Freepik - Flaticon.
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. |
.NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- No dependencies.
-
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.