EasyConsoleApplication 0.7.0-beta0001

This is a prerelease version of EasyConsoleApplication.
There is a newer version of this package available.
See the version list below for details.
dotnet add package EasyConsoleApplication --version 0.7.0-beta0001                
NuGet\Install-Package EasyConsoleApplication -Version 0.7.0-beta0001                
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="EasyConsoleApplication" Version="0.7.0-beta0001" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasyConsoleApplication --version 0.7.0-beta0001                
#r "nuget: EasyConsoleApplication, 0.7.0-beta0001"                
#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 EasyConsoleApplication as a Cake Addin
#addin nuget:?package=EasyConsoleApplication&version=0.7.0-beta0001&prerelease

// Install EasyConsoleApplication as a Cake Tool
#tool nuget:?package=EasyConsoleApplication&version=0.7.0-beta0001&prerelease                

EasyConsoleApplication

A small library to create very simple menu-driven console applications.

Features

  • Easy to use.
  • Supports nested menus.
  • Customizable menu options.

Installation

To install EasyConsoleApplication, you can use NuGet Package Manager:

Install-Package EasyConsoleApplication

Or via .NET CLI:

dotnet add package EasyConsoleApplication

Usage

Here's a basic example of how to use the library:

internal static class Program
{
	private static void Main(string[] _)
	{
		// define the application main menu
		var mainMenu = new Menu("Application");
		mainMenu.Items.Add(new MenuItem("Option 1", () => Console.WriteLine("Action 1")));
		mainMenu.Items.Add(new MenuItem("opt2", "Option 2", () => Console.WriteLine("Action 2")));
		mainMenu.Items.Add(new MenuItem("Go to Home", () => Application.GoTo<HomePage>())
		{
			Color = ConsoleColor.Green
		});
		mainMenu.Items.Add(Separator.Instance);
		mainMenu.Items.Add(new MenuItem("Quit", () => Application.Exit()));

		// render the menu
		Application.Render(mainMenu);

		// application ended via Application.Exit
		Console.WriteLine("Application Terminated.");
		ConsoleHelpers.HitEnterToContinue();
	}
}

public class HomePage : Page
{
	public HomePage()
	{
		Title = "Home";
		TitleColor = ConsoleColor.Green;
		Body = "----";
		BodyColor = ConsoleColor.DarkGreen;
		MenuItems.Add(new MenuItem("Page 1", () => Application.GoTo<Page1>()));
		MenuItems.Add(new MenuItem("Page 2", () => Application.GoTo<Page2>()));
		MenuItems.Add(new MenuItem("Page 3", () => Application.GoTo<Page3>("With Dependency"))
		{
			Color = ConsoleColor.Yellow
		});
		MenuItems.Add(Separator.Instance);
		MenuItems.Add(new MenuItem("Back", () => Application.GoBack()));
		MenuItems.Add(new MenuItem("Quit", () => Application.Exit()));
	}
}

Sample Project

Take a look at the sample project to learn how to use the library in more detail. The sample project demonstrates various features and best practices for creating menu-driven console applications.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue if you have any suggestions or improvements.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 is compatible.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.6.1

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.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.7.1 74 1/27/2025
0.7.0-beta0001 59 1/27/2025
0.6.0 121 10/3/2024
0.5.1 328 2/15/2023
0.4.0 446 4/28/2021
0.3.0 397 4/14/2021
0.2.0 650 7/3/2019
0.1.1 564 6/26/2019
0.1.0 605 5/31/2019
0.1.0-alpha0011 473 5/31/2019
0.1.0-alpha0010 439 5/29/2019
0.1.0-alpha0009 454 5/29/2019
0.1.0-alpha0008 449 5/29/2019
0.1.0-alpha0007 496 4/19/2019
0.1.0-alpha0006 485 3/25/2019