public static void MainMenu() { string[] items = { "User Panel", "Admin Panel", "Collections Panel", "Feeds Panel", "Exit" }; method[] methods = new method[] { UserPanel, AdminPanel, CollectionsPanel, FeedsPanel, Exit }; ConsoleMenu menu = new ConsoleMenu(items); int menuResult; do { menuResult = menu.PrintMenu(); methods[menuResult](); } while (menuResult != items.Length - 1); }
private static void NavigateMenu(string[] items, method[] methods) { ConsoleMenu menu = new ConsoleMenu(items); int menuResult; do { menuResult = menu.PrintMenu(); if (menuResult == items.Length - 1) { continue; } Console.WriteLine(); methods[menuResult](); Console.WriteLine(); Console.WriteLine("Press any key to continue..."); Console.ReadKey(); } while (menuResult != items.Length - 1); }