示例#1
0
        public ConsoleAppRunner(IKernel inKernel, IEnumerable <string> inDictionary) : base(inKernel)
        {
            mReadBuffer                = new ConsoleReadBuffer(inDictionary);
            mReadBuffer.Prompt         = "> ";
            mReadBuffer.BufferUpdated += () => {
                var text = mReadBuffer.Prompt + mReadBuffer.Current;

                System.Console.Write(new String('\b', System.Console.CursorLeft));

                System.Console.CursorLeft = 0;
                System.Console.CursorTop -= text.Length / System.Console.WindowWidth;
                System.Console.Write(mReadBuffer.Prompt + mReadBuffer.Current);
            };

            this.LogUpdated += (message) => {
                System.Console.WriteLine(message);
            };

            this.OnLogUpdated("Enter 'Ctrl + C' for exit application.");
            this.OnLogUpdated("Enter 'Tab' key for word completion.");
            this.OnLogUpdated("Enter 'help' for instructions.");
        }
示例#2
0
        public ConsoleAppRunner(IKernel inKernel, IEnumerable<string> inDictionary)
            : base(inKernel)
        {
            mReadBuffer = new ConsoleReadBuffer(inDictionary);
            mReadBuffer.Prompt = "> ";
            mReadBuffer.BufferUpdated += () => {
                var text = mReadBuffer.Prompt + mReadBuffer.Current;

                System.Console.Write(new String('\b', System.Console.CursorLeft));

                System.Console.CursorLeft = 0;
                System.Console.CursorTop -= text.Length / System.Console.WindowWidth;
                System.Console.Write(mReadBuffer.Prompt + mReadBuffer.Current);
            };

            this.LogUpdated += (message) => {
                System.Console.WriteLine(message);
            };

            this.OnLogUpdated("Enter 'Ctrl + C' for exit application.");
            this.OnLogUpdated("Enter 'Tab' key for word completion.");
            this.OnLogUpdated("Enter 'help' for instructions.");
        }