public void RenderAndProcessAction()
        {
            ConsoleKeyInfo keyinfo;
            bool           actionPerformed = false;

            do
            {
                RenderMenu();

                keyinfo = Console.ReadKey();

                switch (keyinfo.Key)
                {
                case ConsoleKey.DownArrow:
                    if (Options.Last() != SelectedOption)
                    {
                        SelectedOption = Options[Options.IndexOf(SelectedOption) + 1];
                    }
                    break;

                case ConsoleKey.UpArrow:
                    if (Options.First() != SelectedOption)
                    {
                        SelectedOption = Options[Options.IndexOf(SelectedOption) - 1];
                    }
                    break;

                case ConsoleKey.Enter:
                    SetDefaultColors();
                    SelectedOption.OnSelected();
                    actionPerformed = true;
                    break;
                }
            }while (!actionPerformed);
        }
 private void SetupColors(ConsoleMenuOption option)
 {
     if (SelectedOption == option)
     {
         SetInverseColors();
     }
     else
     {
         SetDefaultColors();
     }
 }
 public ConsoleMenu(string header, IList <ConsoleMenuOption> options)
 {
     Header         = header;
     Options        = options;
     SelectedOption = Options.First();
 }