1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
5
using System.Collections.Generic;
8
using ICSharpCode.Scripting;
9
using Microsoft.Scripting.Hosting.Shell;
11
namespace ICSharpCode.RubyBinding
13
public class RubyConsole : ThreadSafeScriptingConsole, IConsole, IMemberProvider
15
IScriptingConsoleTextEditor textEditor;
16
IControlDispatcher dispatcher;
18
public RubyConsole(IScriptingConsoleTextEditor textEditor, IControlDispatcher dispatcher)
19
: this(new ScriptingConsole(textEditor), dispatcher)
21
this.textEditor = textEditor;
24
RubyConsole(ScriptingConsole console, IControlDispatcher dispatcher)
25
: base(console, dispatcher)
27
this.dispatcher = dispatcher;
28
console.MemberProvider = this;
31
public ScriptingConsoleOutputStream CreateOutputStream()
33
return new ScriptingConsoleOutputStream(textEditor, dispatcher);
36
public CommandLine CommandLine { get; set; }
38
public TextWriter Output {
43
public TextWriter ErrorOutput {
48
public void Write(string text, Style style)
50
base.Write(text, (ScriptingStyle)style);
53
public void WriteLine(string text, Style style)
55
base.WriteLine(text, (ScriptingStyle)style);
58
public IList<string> GetMemberNames(string name)
60
return CommandLine.GetMemberNames(name);
63
public IList<string> GetGlobals(string name)
65
return CommandLine.GetGlobals(name);