Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ a simple and customisable c# console menu system
// Setup the menu
ConsoleMenu mainMenu = new ConsoleMenu();

ConsoleMenu subMenu1 = new ConsoleMenu("==>");
Menu subMenu1 = new ("==>");
subMenu1.SubTitle = "---------------- Secret Menu -----------------";
subMenu1.addMenuItem(0, "backToMain", subMenu1.hideMenu);
subMenu1.AddMenuItem("backToMain", subMenu1.Back);
subMenu1.ParentMenu = mainMenu;

mainMenu.Header = headerText;
subMenu1.Header = mainMenu.Header;

mainMenu.SubTitle = "-------------------- Menu ----------------------";
mainMenu.addMenuItem(0, "Hello World!", HelloWorld);
mainMenu.addMenuItem(1, "Secret Menu", subMenu1.showMenu);
mainMenu.addMenuItem(2, "Exit", Exit);
mainMenu.AddMenuItem("Hello World!", HelloWorld);
mainMenu.AddMenuItem("Secret Menu", subMenu1.ShowMenu);
mainMenu.AddMenuItem("Exit", Exit);
// Display the menu
mainMenu.showMenu();
mainMenu.ShowMenu();
```
43 changes: 43 additions & 0 deletions Sample/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using SimpleConsoleMenu;

string headerText = " __ __ _____ _ " +
Environment.NewLine + " | \\/ | / ____| | | " +
Environment.NewLine + " | \\ / | ___ _ __ _ _ | (___ _ _ ___| |_ ___ _ __ ___" +
Environment.NewLine + " | |\\/| |/ _ \\ '_ \\| | | | \\___ \\| | | / __| __/ _ \\ '_ ` _ \\" +
Environment.NewLine + " | | | | __/ | | | |_| | ____) | |_| \\__ \\ || __/ | | | | |" +
Environment.NewLine + " |_| |_|\\___|_| |_|\\__,_| |_____/ \\__, |___/\\__\\___|_| |_| |_|" +
Environment.NewLine + " __/ | " +
Environment.NewLine + " |___/ ";


Console.Clear();

// Setup the menu
Menu mainMenu = new ();

Menu subMenu1 = new ("==>");
subMenu1.SubTitle = "---------------- Secret Menu -----------------";
subMenu1.AddMenuItem("backToMain", subMenu1.Back);
subMenu1.ParentMenu = mainMenu;

mainMenu.Header = headerText;
subMenu1.Header = mainMenu.Header;

mainMenu.SubTitle = "-------------------- Menu ----------------------";
mainMenu.AddMenuItem("Hello World!", HelloWorld);
mainMenu.AddMenuItem("Secret Menu", subMenu1.ShowMenu);
mainMenu.AddMenuItem("Exit", Exit);
// Display the menu
mainMenu.ShowMenu();


static void Exit()
{
Environment.Exit(0);
}

static void HelloWorld()
{
Console.WriteLine("Hello World!");
Console.ReadKey(true);
}
14 changes: 14 additions & 0 deletions Sample/Sample.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\SimpleConsoleMenu\SimpleConsoleMenu.csproj" />
</ItemGroup>

</Project>
23 changes: 16 additions & 7 deletions SimpleCMenu.sln
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
# Visual Studio Version 17
VisualStudioVersion = 17.3.32819.101
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleCMenu", "SimpleCMenu\SimpleCMenu.csproj", "{15368273-1C43-4939-977F-0C198643CF42}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleConsoleMenu", "SimpleConsoleMenu\SimpleConsoleMenu.csproj", "{61FB74BD-D547-4B8E-BB15-C409F74DE782}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample", "Sample\Sample.csproj", "{E687D971-7479-4F51-9C1E-FF6ED063B2DE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{15368273-1C43-4939-977F-0C198643CF42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{15368273-1C43-4939-977F-0C198643CF42}.Debug|Any CPU.Build.0 = Debug|Any CPU
{15368273-1C43-4939-977F-0C198643CF42}.Release|Any CPU.ActiveCfg = Release|Any CPU
{15368273-1C43-4939-977F-0C198643CF42}.Release|Any CPU.Build.0 = Release|Any CPU
{61FB74BD-D547-4B8E-BB15-C409F74DE782}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{61FB74BD-D547-4B8E-BB15-C409F74DE782}.Debug|Any CPU.Build.0 = Debug|Any CPU
{61FB74BD-D547-4B8E-BB15-C409F74DE782}.Release|Any CPU.ActiveCfg = Release|Any CPU
{61FB74BD-D547-4B8E-BB15-C409F74DE782}.Release|Any CPU.Build.0 = Release|Any CPU
{E687D971-7479-4F51-9C1E-FF6ED063B2DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E687D971-7479-4F51-9C1E-FF6ED063B2DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E687D971-7479-4F51-9C1E-FF6ED063B2DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E687D971-7479-4F51-9C1E-FF6ED063B2DE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {76E8BADE-17FB-4DF9-A7C8-32438D9A06D5}
EndGlobalSection
EndGlobal
6 changes: 0 additions & 6 deletions SimpleCMenu/App.config

This file was deleted.

188 changes: 0 additions & 188 deletions SimpleCMenu/Menu/ConsoleMenu.cs

This file was deleted.

31 changes: 0 additions & 31 deletions SimpleCMenu/Menu/MenuItem.cs

This file was deleted.

Loading