diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj b/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj index bd579f52c1..efb60cdc96 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj @@ -149,7 +149,6 @@ - diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonConsoleHost.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonConsoleHost.cs index c7f42b8e14..9a71736aa0 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonConsoleHost.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonConsoleHost.cs @@ -71,12 +71,12 @@ namespace ICSharpCode.PythonBinding /// protected override IConsole CreateConsole(ScriptEngine engine, CommandLine commandLine, ConsoleOptions options) { - SetOutput(new PythonOutputStream(textEditor)); + SetOutput(new ScriptingConsoleOutputStream(textEditor)); pythonConsole.CommandLine = commandLine; return pythonConsole; } - protected virtual void SetOutput(PythonOutputStream stream) + protected virtual void SetOutput(ScriptingConsoleOutputStream stream) { Runtime.IO.SetOutput(stream, Encoding.UTF8); } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonOutputStream.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonOutputStream.cs deleted file mode 100644 index e064c9e8b9..0000000000 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonOutputStream.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) - -using System; -using System.IO; -using System.Text; - -using ICSharpCode.Scripting; - -namespace ICSharpCode.PythonBinding -{ - public class PythonOutputStream : Stream - { - IScriptingConsoleTextEditor textEditor; - - public PythonOutputStream(IScriptingConsoleTextEditor textEditor) - { - this.textEditor = textEditor; - } - - public override bool CanRead { - get { return false; } - } - - public override bool CanSeek { - get { return false; } - } - - public override bool CanWrite { - get { return true; } - } - - public override long Length { - get { return 0; } - } - - public override long Position { - get { return 0; } - set { } - } - - public override void Flush() - { - } - - public override long Seek(long offset, SeekOrigin origin) - { - return 0; - } - - public override void SetLength(long value) - { - } - - public override int Read(byte[] buffer, int offset, int count) - { - return 0; - } - - /// - /// Assumes the bytes are UTF8 and writes them to the text editor. - /// - public override void Write(byte[] buffer, int offset, int count) - { - string text = UTF8Encoding.UTF8.GetString(buffer, offset, count); - textEditor.Write(text); - } - } -} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj b/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj index 06527e58ce..8be0f920df 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj @@ -116,7 +116,6 @@ - diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/DerivedPythonConsoleHost.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/DerivedPythonConsoleHost.cs index 132d615f1e..2b9ddd907a 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/DerivedPythonConsoleHost.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/DerivedPythonConsoleHost.cs @@ -13,7 +13,7 @@ namespace PythonBinding.Tests.Console { public class DerivedPythonConsoleHost : PythonConsoleHost { - PythonOutputStream outputStream; + ScriptingConsoleOutputStream outputStream; public DerivedPythonConsoleHost(IScriptingConsoleTextEditor textEditor) : base(textEditor) { @@ -42,11 +42,11 @@ namespace PythonBinding.Tests.Console /// /// Gets the output stream class passed to SetOutput method. /// - public PythonOutputStream OutputStream { + public ScriptingConsoleOutputStream OutputStream { get { return outputStream; } } - protected override void SetOutput(PythonOutputStream stream) + protected override void SetOutput(ScriptingConsoleOutputStream stream) { outputStream = stream; } diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/RubyBinding.csproj b/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/RubyBinding.csproj index e237d66f8c..9119ac251f 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/RubyBinding.csproj +++ b/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/RubyBinding.csproj @@ -112,7 +112,6 @@ - diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyConsoleHost.cs b/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyConsoleHost.cs index 7105f495fa..2e3f102f68 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyConsoleHost.cs +++ b/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyConsoleHost.cs @@ -55,7 +55,7 @@ namespace ICSharpCode.RubyBinding Run(new string[0]); } - protected virtual void SetOutput(RubyOutputStream stream) + protected virtual void SetOutput(ScriptingConsoleOutputStream stream) { Runtime.IO.SetOutput(stream, Encoding.UTF8); } @@ -87,7 +87,7 @@ namespace ICSharpCode.RubyBinding /// protected override IConsole CreateConsole(ScriptEngine engine, CommandLine commandLine, ConsoleOptions options) { - SetOutput(new RubyOutputStream(textEditor)); + SetOutput(new ScriptingConsoleOutputStream(textEditor)); rubyConsole.CommandLine = commandLine; return rubyConsole; } diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Console/RubyOutputStreamTestFixture.cs b/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Console/RubyOutputStreamTestFixture.cs deleted file mode 100644 index 5b6b56102c..0000000000 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Console/RubyOutputStreamTestFixture.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) - -using System; -using System.IO; -using System.Text; - -using ICSharpCode.RubyBinding; -using ICSharpCode.Scripting.Tests.Utils; -using NUnit.Framework; -using RubyBinding.Tests.Utils; - -namespace RubyBinding.Tests.Console -{ - [TestFixture] - public class RubyOutputStreamTestFixture - { - RubyOutputStream stream; - MockConsoleTextEditor textEditor; - - [TestFixtureSetUp] - public void SetUpFixture() - { - textEditor = new MockConsoleTextEditor(); - stream = new RubyOutputStream(textEditor); - } - - [Test] - public void CanReadIsFalse() - { - Assert.IsFalse(stream.CanRead); - } - - [Test] - public void CanSeekIsFalse() - { - Assert.IsFalse(stream.CanSeek); - } - - [Test] - public void CanWriteIsTrue() - { - Assert.IsTrue(stream.CanWrite); - } - - [Test] - public void WriteAddsTextToTextEditor() - { - textEditor.Text = String.Empty; - byte[] bytes = UTF8Encoding.UTF8.GetBytes("test"); - stream.Write(bytes, 0, bytes.Length); - - Assert.AreEqual("test", textEditor.Text); - } - - [Test] - public void OffsetAndLengthUsedInWriteMethod() - { - textEditor.Text = String.Empty; - byte[] bytes = UTF8Encoding.UTF8.GetBytes("0output1"); - stream.Write(bytes, 1, bytes.Length - 2); - - Assert.AreEqual("output", textEditor.Text); - } - } -} diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RubyBinding.Tests.csproj b/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RubyBinding.Tests.csproj index 744262558d..6f310313dd 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RubyBinding.Tests.csproj +++ b/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RubyBinding.Tests.csproj @@ -86,7 +86,6 @@ - diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/DerivedRubyConsoleHost.cs b/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/DerivedRubyConsoleHost.cs index cc6b0ccb68..fa122e3f43 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/DerivedRubyConsoleHost.cs +++ b/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/DerivedRubyConsoleHost.cs @@ -13,7 +13,7 @@ namespace RubyBinding.Tests.Console { public class DerivedRubyConsoleHost : RubyConsoleHost { - RubyOutputStream outputStream; + ScriptingConsoleOutputStream outputStream; public DerivedRubyConsoleHost(IScriptingConsoleTextEditor textEditor) : base(textEditor) { @@ -47,11 +47,11 @@ namespace RubyBinding.Tests.Console /// /// Gets the output stream class passed to SetOutput method. /// - public RubyOutputStream OutputStream { + public ScriptingConsoleOutputStream OutputStream { get { return outputStream; } } - protected override void SetOutput(RubyOutputStream stream) + protected override void SetOutput(ScriptingConsoleOutputStream stream) { outputStream = stream; } diff --git a/src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj b/src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj index 4029360416..2ee4c14431 100644 --- a/src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj +++ b/src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj @@ -78,6 +78,7 @@ + diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyOutputStream.cs b/src/AddIns/BackendBindings/Scripting/Project/Src/ScriptingConsoleOutputStream.cs similarity index 87% rename from src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyOutputStream.cs rename to src/AddIns/BackendBindings/Scripting/Project/Src/ScriptingConsoleOutputStream.cs index d53675e75a..0ccb3c7be3 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyOutputStream.cs +++ b/src/AddIns/BackendBindings/Scripting/Project/Src/ScriptingConsoleOutputStream.cs @@ -5,15 +5,13 @@ using System; using System.IO; using System.Text; -using ICSharpCode.Scripting; - -namespace ICSharpCode.RubyBinding +namespace ICSharpCode.Scripting { - public class RubyOutputStream : Stream + public class ScriptingConsoleOutputStream : Stream { IScriptingConsoleTextEditor textEditor; - public RubyOutputStream(IScriptingConsoleTextEditor textEditor) + public ScriptingConsoleOutputStream(IScriptingConsoleTextEditor textEditor) { this.textEditor = textEditor; } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Console/PythonOutputStreamTestFixture.cs b/src/AddIns/BackendBindings/Scripting/Test/Console/ScriptingConsoleOutputStreamTests.cs similarity index 84% rename from src/AddIns/BackendBindings/Python/PythonBinding/Test/Console/PythonOutputStreamTestFixture.cs rename to src/AddIns/BackendBindings/Scripting/Test/Console/ScriptingConsoleOutputStreamTests.cs index de0ff11c23..e0b869ed34 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Console/PythonOutputStreamTestFixture.cs +++ b/src/AddIns/BackendBindings/Scripting/Test/Console/ScriptingConsoleOutputStreamTests.cs @@ -5,24 +5,23 @@ using System; using System.IO; using System.Text; -using ICSharpCode.PythonBinding; +using ICSharpCode.Scripting; using ICSharpCode.Scripting.Tests.Utils; using NUnit.Framework; -using PythonBinding.Tests.Utils; -namespace PythonBinding.Tests.Console +namespace ICSharpCode.Scripting.Tests.Console { [TestFixture] - public class PythonOutputStreamTestFixture + public class ScriptingConsoleOutputStreamTestFixture { - PythonOutputStream stream; + ScriptingConsoleOutputStream stream; MockConsoleTextEditor textEditor; [TestFixtureSetUp] public void SetUpFixture() { textEditor = new MockConsoleTextEditor(); - stream = new PythonOutputStream(textEditor); + stream = new ScriptingConsoleOutputStream(textEditor); } [Test] diff --git a/src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj b/src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj index e9f482e03a..c3f48b1924 100644 --- a/src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj +++ b/src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj @@ -73,6 +73,7 @@ +