Browse Source

Move IronPython and IronRuby text editor view content class to common Scripting project.

pull/1/head
mrward 15 years ago
parent
commit
7573e8313a
  1. 1
      src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj
  2. 4
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/ConvertToPythonMenuCommand.cs
  3. 3
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFormsDesignerDisplayBinding.cs
  4. 59
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTextEditorViewContent.cs
  5. 4
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/SendLineToPythonConsoleCommand.cs
  6. 1
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/RubyBinding.csproj
  7. 4
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/ConvertToRubyMenuCommand.cs
  8. 3
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyFormsDesignerDisplayBinding.cs
  9. 4
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/SendLineToRubyConsoleCommand.cs
  10. 1
      src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj
  11. 9
      src/AddIns/BackendBindings/Scripting/Project/Src/ScriptingTextEditorViewContent.cs

1
src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj

@ -117,7 +117,6 @@
<Compile Include="Src\PythonTestRunnerApplication.cs" /> <Compile Include="Src\PythonTestRunnerApplication.cs" />
<Compile Include="Src\PythonTestRunnerContext.cs" /> <Compile Include="Src\PythonTestRunnerContext.cs" />
<Compile Include="Src\PythonTestRunnerResponseFile.cs" /> <Compile Include="Src\PythonTestRunnerResponseFile.cs" />
<Compile Include="Src\PythonTextEditorViewContent.cs" />
<Compile Include="Src\PythonWorkbench.cs" /> <Compile Include="Src\PythonWorkbench.cs" />
<Compile Include="Src\SendLineToPythonConsoleCommand.cs" /> <Compile Include="Src\SendLineToPythonConsoleCommand.cs" />
<Compile Include="Src\SysModuleCompletionItems.cs" /> <Compile Include="Src\SysModuleCompletionItems.cs" />

4
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/ConvertToPythonMenuCommand.cs

@ -18,7 +18,7 @@ namespace ICSharpCode.PythonBinding
/// </summary> /// </summary>
public class ConvertToPythonMenuCommand : AbstractMenuCommand public class ConvertToPythonMenuCommand : AbstractMenuCommand
{ {
PythonTextEditorViewContent view; ScriptingTextEditorViewContent view;
public override void Run() public override void Run()
{ {
@ -27,7 +27,7 @@ namespace ICSharpCode.PythonBinding
protected void Run(IScriptingWorkbench workbench) protected void Run(IScriptingWorkbench workbench)
{ {
view = new PythonTextEditorViewContent(workbench); view = new ScriptingTextEditorViewContent(workbench);
string code = GeneratePythonCode(); string code = GeneratePythonCode();
ShowPythonCodeInNewWindow(code); ShowPythonCodeInNewWindow(code);
} }

3
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFormsDesignerDisplayBinding.cs

@ -7,6 +7,7 @@
using System; using System;
using ICSharpCode.FormsDesigner; using ICSharpCode.FormsDesigner;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor;
@ -45,7 +46,7 @@ namespace ICSharpCode.PythonBinding
public IViewContent[] CreateSecondaryViewContent(IViewContent viewContent) public IViewContent[] CreateSecondaryViewContent(IViewContent viewContent)
{ {
PythonTextEditorViewContent textEditorView = new PythonTextEditorViewContent(viewContent); ScriptingTextEditorViewContent textEditorView = new ScriptingTextEditorViewContent(viewContent);
return CreateSecondaryViewContent(viewContent, textEditorView.TextEditorOptions); return CreateSecondaryViewContent(viewContent, textEditorView.TextEditorOptions);
} }

59
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTextEditorViewContent.cs

@ -1,59 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
// <version>$Revision$</version>
// </file>
using System;
using ICSharpCode.Core;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.PythonBinding
{
public class PythonTextEditorViewContent
{
IViewContent view;
IEditable editable;
ITextEditorProvider textEditorProvider;
ITextEditor textEditor;
ITextEditorOptions textEditorOptions;
public PythonTextEditorViewContent(IScriptingWorkbench workbench)
{
Init(workbench.ActiveViewContent);
}
public PythonTextEditorViewContent(IViewContent view)
{
Init(view);
}
void Init(IViewContent view)
{
this.view = view;
editable = view as IEditable;
textEditorProvider = view as ITextEditorProvider;
textEditor = textEditorProvider.TextEditor;
textEditorOptions = textEditor.Options;
}
public FileName PrimaryFileName {
get { return view.PrimaryFileName; }
}
public IEditable EditableView {
get { return editable; }
}
public ITextEditor TextEditor {
get { return textEditor; }
}
public ITextEditorOptions TextEditorOptions {
get { return textEditorOptions; }
}
}
}

4
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/SendLineToPythonConsoleCommand.cs

@ -17,7 +17,7 @@ namespace ICSharpCode.PythonBinding
{ {
IScriptingWorkbench workbench; IScriptingWorkbench workbench;
IScriptingConsolePad consolePad; IScriptingConsolePad consolePad;
PythonTextEditorViewContent textEditorView; ScriptingTextEditorViewContent textEditorView;
ITextEditor activeTextEditor; ITextEditor activeTextEditor;
IScriptingConsole pythonConsole; IScriptingConsole pythonConsole;
string lineFromActiveTextEditor; string lineFromActiveTextEditor;
@ -31,7 +31,7 @@ namespace ICSharpCode.PythonBinding
{ {
this.workbench = workbench; this.workbench = workbench;
textEditorView = new PythonTextEditorViewContent(workbench); textEditorView = new ScriptingTextEditorViewContent(workbench);
activeTextEditor = textEditorView.TextEditor; activeTextEditor = textEditorView.TextEditor;
} }

1
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/RubyBinding.csproj

@ -123,7 +123,6 @@
<Compile Include="Src\RubyTestRunnerApplication.cs" /> <Compile Include="Src\RubyTestRunnerApplication.cs" />
<Compile Include="Src\RubyTestRunnerContext.cs" /> <Compile Include="Src\RubyTestRunnerContext.cs" />
<Compile Include="Src\RubyTestRunnerResponseFile.cs" /> <Compile Include="Src\RubyTestRunnerResponseFile.cs" />
<Compile Include="Src\RubyTextEditorViewContent.cs" />
<Compile Include="Src\RubyWorkbench.cs" /> <Compile Include="Src\RubyWorkbench.cs" />
<Compile Include="Src\RunDebugRubyCommand.cs" /> <Compile Include="Src\RunDebugRubyCommand.cs" />
<Compile Include="Src\RunRubyCommand.cs" /> <Compile Include="Src\RunRubyCommand.cs" />

4
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/ConvertToRubyMenuCommand.cs

@ -19,7 +19,7 @@ namespace ICSharpCode.RubyBinding
/// </summary> /// </summary>
public class ConvertToRubyMenuCommand : AbstractMenuCommand public class ConvertToRubyMenuCommand : AbstractMenuCommand
{ {
RubyTextEditorViewContent view; ScriptingTextEditorViewContent view;
public override void Run() public override void Run()
{ {
@ -28,7 +28,7 @@ namespace ICSharpCode.RubyBinding
protected void Run(IScriptingWorkbench workbench) protected void Run(IScriptingWorkbench workbench)
{ {
view = new RubyTextEditorViewContent(workbench); view = new ScriptingTextEditorViewContent(workbench);
string code = GenerateRubyCode(); string code = GenerateRubyCode();
ShowRubyCodeInNewWindow(code); ShowRubyCodeInNewWindow(code);
} }

3
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyFormsDesignerDisplayBinding.cs

@ -7,6 +7,7 @@
using System; using System;
using ICSharpCode.FormsDesigner; using ICSharpCode.FormsDesigner;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor;
@ -45,7 +46,7 @@ namespace ICSharpCode.RubyBinding
public IViewContent[] CreateSecondaryViewContent(IViewContent viewContent) public IViewContent[] CreateSecondaryViewContent(IViewContent viewContent)
{ {
RubyTextEditorViewContent textEditorView = new RubyTextEditorViewContent(viewContent); ScriptingTextEditorViewContent textEditorView = new ScriptingTextEditorViewContent(viewContent);
return CreateSecondaryViewContent(viewContent, textEditorView.TextEditorOptions); return CreateSecondaryViewContent(viewContent, textEditorView.TextEditorOptions);
} }

4
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/SendLineToRubyConsoleCommand.cs

@ -17,7 +17,7 @@ namespace ICSharpCode.RubyBinding
{ {
IScriptingWorkbench workbench; IScriptingWorkbench workbench;
IScriptingConsolePad consolePad; IScriptingConsolePad consolePad;
RubyTextEditorViewContent textEditorView; ScriptingTextEditorViewContent textEditorView;
ITextEditor activeTextEditor; ITextEditor activeTextEditor;
IScriptingConsole RubyConsole; IScriptingConsole RubyConsole;
string lineFromActiveTextEditor; string lineFromActiveTextEditor;
@ -31,7 +31,7 @@ namespace ICSharpCode.RubyBinding
{ {
this.workbench = workbench; this.workbench = workbench;
textEditorView = new RubyTextEditorViewContent(workbench); textEditorView = new ScriptingTextEditorViewContent(workbench);
activeTextEditor = textEditorView.TextEditor; activeTextEditor = textEditorView.TextEditor;
} }

1
src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj

@ -82,6 +82,7 @@
<Compile Include="Src\ScriptingConsoleTextEditorKeyEventArgs.cs" /> <Compile Include="Src\ScriptingConsoleTextEditorKeyEventArgs.cs" />
<Compile Include="Src\ScriptingFileService.cs" /> <Compile Include="Src\ScriptingFileService.cs" />
<Compile Include="Src\ScriptingNameCreationService.cs" /> <Compile Include="Src\ScriptingNameCreationService.cs" />
<Compile Include="Src\ScriptingTextEditorViewContent.cs" />
<Compile Include="Src\ScriptingWorkbench.cs" /> <Compile Include="Src\ScriptingWorkbench.cs" />
<Compile Include="Src\StringListLock.cs" /> <Compile Include="Src\StringListLock.cs" />
<Compile Include="Src\ThreadSafeScriptingConsoleTextEditor.cs" /> <Compile Include="Src\ThreadSafeScriptingConsoleTextEditor.cs" />

9
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTextEditorViewContent.cs → src/AddIns/BackendBindings/Scripting/Project/Src/ScriptingTextEditorViewContent.cs

@ -7,13 +7,12 @@
using System; using System;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.RubyBinding namespace ICSharpCode.Scripting
{ {
public class RubyTextEditorViewContent public class ScriptingTextEditorViewContent
{ {
IViewContent view; IViewContent view;
IEditable editable; IEditable editable;
@ -21,12 +20,12 @@ namespace ICSharpCode.RubyBinding
ITextEditor textEditor; ITextEditor textEditor;
ITextEditorOptions textEditorOptions; ITextEditorOptions textEditorOptions;
public RubyTextEditorViewContent(IScriptingWorkbench workbench) public ScriptingTextEditorViewContent(IScriptingWorkbench workbench)
{ {
Init(workbench.ActiveViewContent); Init(workbench.ActiveViewContent);
} }
public RubyTextEditorViewContent(IViewContent view) public ScriptingTextEditorViewContent(IViewContent view)
{ {
Init(view); Init(view);
} }
Loading…
Cancel
Save