Beispiel #1
0
        public void Run()
        {
            while (true)
            {
                Show();

                var selectionIndex = KLConsole.ReadInt("Select an item: ");

                var selection = MenuItems.FirstOrDefault(x => x.Key == selectionIndex);

                if (selection != null)
                {
                    KLConsole.Clear();

                    var reshowMenu = selection.Execute();

                    if (!reshowMenu)
                    {
                        break;
                    }

                    KLConsole.WriteLine();
                    KLConsole.ReadKey("Press any key to continue...");
                }
            }
        }