internal void Run()
        {
            while (true)
            {
                forumViewer.Mark(menuController.CurrentLabel);

                var keyInfo = Console.ReadKey(true);
                var key     = keyInfo.Key;

                forumViewer.Mark(menuController.CurrentLabel, false);

                switch (key)
                {
                case ConsoleKey.LeftArrow:
                case ConsoleKey.UpArrow:
                    menuController.PreviousOption();
                    break;

                case ConsoleKey.Tab:
                case ConsoleKey.RightArrow:
                case ConsoleKey.DownArrow:
                    menuController.NextOption();
                    break;

                case ConsoleKey.Enter:
                    menuController.SelectOption();
                    break;
                }
            }
        }
Exemple #2
0
        internal void Run()
        {
            while (true)
            {
                _forumViewer.Mark(_menuController.CurrentLabel);

                ConsoleKeyInfo keyInfo = Console.ReadKey(true);
                ConsoleKey     key     = keyInfo.Key;

                _forumViewer.Mark(_menuController.CurrentLabel, false);

                switch (key)
                {
                case ConsoleKey.Backspace:
                case ConsoleKey.Escape:
                    _menuController.Back();
                    break;

                case ConsoleKey.Home:
                    break;

                case ConsoleKey.LeftArrow:
                case ConsoleKey.UpArrow:
                    _menuController.PreviousOption();
                    break;

                case ConsoleKey.Tab:
                case ConsoleKey.RightArrow:
                case ConsoleKey.DownArrow:
                    _menuController.NextOption();
                    break;

                case ConsoleKey.Enter:
                    _menuController.ExecuteCommand();
                    break;
                }
            }
        }