Beispiel #1
0
        public static void PrintControls()
        {
            const string line = " - ";
            const string tab  = "    ";

            string[] newInstanceString =
            {
                "RETURN",  "compile&execute",
                "Q",       "exit",
                "F",       "choose file",
                "T/Ctr-T", "ACtest"
            };

            _lengthOfControls = 0;

            for (var i = 0; i < newInstanceString.Length; i++)
            {
                _lengthOfControls += (uint)newInstanceString[i].Length;
                ConsoleColors.SetAndPushColors(Green);
                Console.Write(newInstanceString[i++]);
                ConsoleColors.SetPreviousAndPopColors();
                ConsoleColors.SetAndPushColors(Yellow);
                Console.Write(line);
                ConsoleColors.SetPreviousAndPopColors();
                _lengthOfControls += (uint)newInstanceString[i].Length;
                ConsoleColors.SetAndPushColors(Cyan);
                Console.Write(newInstanceString[i]);
                if (!i.Equals(newInstanceString.Length - 1))
                {
                    Console.Write(tab);
                }

                ConsoleColors.SetPreviousAndPopColors();
            }

            _lengthOfControls += (uint)(newInstanceString.Length / 2 * line.Length +
                                        (newInstanceString.Length / 2 - 1) * tab.Length);
        }