示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Shell"/> class.
        /// </summary>
        public Shell()
        {
            CommandBindings.Add(new CommandBinding(ShellCommands.Clear, HandleClearCommand));
            CommandBindings.Add(new CommandBinding(ShellCommands.Execute, HandleExecuteCommand));
            CommandBindings.Add(new CommandBinding(ShellCommands.CommandHistoryUp, HandleHistoryUpCommand));
            CommandBindings.Add(new CommandBinding(ShellCommands.CommandHistoryDown, HandleHistoryDownCommand));

            OutputDocument = new FlowDocument(_outputParagraph = new Paragraph());
            History = new CommandHistory();
            OutputFormatter = new ShellOutputFormatter {DelayNewlines = true};

            _writer = new CallbackScriptOutputWriter(
                OutputWriter_OutputWritten,
                OutputWriter_Clear
                );
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Shell"/> class.
        /// </summary>
        public Shell()
        {
            CommandBindings.Add(new CommandBinding(ShellCommands.Clear, HandleClearCommand));
            CommandBindings.Add(new CommandBinding(ShellCommands.Execute, HandleExecuteCommand));
            CommandBindings.Add(new CommandBinding(ShellCommands.CommandHistoryUp, HandleHistoryUpCommand));
            CommandBindings.Add(new CommandBinding(ShellCommands.CommandHistoryDown, HandleHistoryDownCommand));

            OutputDocument  = new FlowDocument(_outputParagraph = new Paragraph());
            History         = new CommandHistory();
            OutputFormatter = new ShellOutputFormatter {
                DelayNewlines = true
            };

            _writer = new CallbackScriptOutputWriter(
                OutputWriter_OutputWritten,
                OutputWriter_Clear
                );
        }