Пример #1
0
        public void ShowCredits()
        {
            creditWindow.Render();
            bool needToRender = true;

            do
            {
                while (Console.KeyAvailable)
                {
                    ConsoleKeyInfo pressedChar = Console.ReadKey(true);
                    int            hashCode    = pressedChar.Key.GetHashCode();

                    switch (hashCode)
                    {
                    case 27:     //ConsoleKey.Escape:
                        needToRender = false;
                        Console.Clear();
                        break;

                    case 13:
                        Console.Clear();
                        ShowMenu();
                        needToRender = false;
                        break;
                    }
                }

                System.Threading.Thread.Sleep(250);
            } while (needToRender);
        }
Пример #2
0
        public void ShowCredits()
        {
            creditWindow.Render();
            int hashCode = 0;

            while (true)
            {
                if (hashCode == 13)
                {
                    break;
                }
                else if (hashCode == 27)
                {
                    break;
                }
                else
                {
                    ConsoleKeyInfo pressedChar = Console.ReadKey(true);
                    hashCode = pressedChar.Key.GetHashCode();
                }
            }
        }