public void Init() { textEditor = new FakeConsoleTextEditor(); dispatcher = new FakeControlDispatcher(); dispatcher.CheckAccessReturnValue = true; stream = new ScriptingConsoleOutputStream(textEditor, dispatcher); }
/// <remarks> /// After the engine is created the standard output is replaced with our custom Stream class so we /// can redirect the stdout to the text editor window. /// This can be done in this method since the Runtime object will have been created before this method /// is called. /// </remarks> protected override IConsole CreateConsole(ScriptEngine engine, CommandLine commandLine, ConsoleOptions options) { ScriptingConsoleOutputStream stream = rubyConsole.CreateOutputStream(); SetOutput(stream); rubyConsole.CommandLine = commandLine; return(rubyConsole); }
protected virtual void SetOutput(ScriptingConsoleOutputStream stream) { Runtime.IO.SetOutput(stream, Encoding.UTF8); }
protected override void SetOutput(ScriptingConsoleOutputStream stream) { outputStream = stream; }