Exemplo n.º 1
0
        public ConsolePlusInstance()
        {
            interruptInput = InputInterruption.None;
            history        = new Queue <string>();
            historyIndex   = -1;
            input          = new StringBuilder();

            SetTheme(ConsolePlusTheme.Default);
        }
Exemplo n.º 2
0
        // [Update]
        protected void ExecuteKeyAction(ConsoleKeyInfo keyInfo)
        {
            if (keyInfo.IsLetter() || keyInfo.IsNumber() || keyInfo.Key == ConsoleKey.Spacebar)
            {
                Console.Write(keyInfo.KeyChar);
                input.Append(keyInfo.KeyChar);
            }
            else if (keyInfo.IsArrowKey())
            {
                Console.Write(keyInfo.Key);
            }
            else
            {
                Console.Write(keyInfo.Key);
                switch (keyInfo.Key)
                {
                case ConsoleKey.Home:

                    break;

                case ConsoleKey.End:

                    break;

                case ConsoleKey.Enter:
                    interruptInput = InputInterruption.Natural;
                    break;

                case ConsoleKey.Escape:
                    interruptInput = InputInterruption.Forced;
                    break;
                }
            }

            Console.Write(" ");

            UpdateConsole();
        }