23 changed files with 72 additions and 121 deletions
@ -1,19 +0,0 @@
@@ -1,19 +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.Scripting; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
|
||||
namespace ICSharpCode.PythonBinding |
||||
{ |
||||
public interface IPythonWorkbench |
||||
{ |
||||
IScriptingConsolePad GetScriptingConsolePad(); |
||||
IViewContent ActiveViewContent { get; } |
||||
} |
||||
} |
@ -1,46 +0,0 @@
@@ -1,46 +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 System.Collections.Generic; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.PythonBinding; |
||||
using ICSharpCode.Scripting; |
||||
using ICSharpCode.Scripting.Tests.Utils; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
|
||||
namespace PythonBinding.Tests.Utils |
||||
{ |
||||
public class MockWorkbench : IPythonWorkbench |
||||
{ |
||||
public MockScriptingConsolePad MockScriptingConsolePad = new MockScriptingConsolePad(); |
||||
public MockEditableViewContent ActiveMockEditableViewContent; |
||||
|
||||
public static MockWorkbench CreateWorkbenchWithOneViewContent(string fileName) |
||||
{ |
||||
MockEditableViewContent viewContent = new MockEditableViewContent(); |
||||
viewContent.PrimaryFileName = new FileName(fileName); |
||||
|
||||
MockWorkbench workbench = new MockWorkbench(); |
||||
workbench.ActiveMockEditableViewContent = viewContent; |
||||
|
||||
return workbench; |
||||
} |
||||
|
||||
public IViewContent ActiveViewContent { |
||||
get { return ActiveMockEditableViewContent; } |
||||
} |
||||
|
||||
public IScriptingConsolePad GetScriptingConsolePad() |
||||
{ |
||||
return MockScriptingConsolePad; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
// <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.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
|
||||
namespace ICSharpCode.Scripting |
||||
{ |
||||
public class ScriptingWorkbench : IScriptingWorkbench |
||||
{ |
||||
Type consolePadType; |
||||
IWorkbench workbench; |
||||
|
||||
public ScriptingWorkbench(Type consolePadType) |
||||
{ |
||||
this.consolePadType = consolePadType; |
||||
workbench = WorkbenchSingleton.Workbench; |
||||
} |
||||
|
||||
public IViewContent ActiveViewContent { |
||||
get { return workbench.ActiveViewContent; } |
||||
} |
||||
|
||||
public IScriptingConsolePad GetScriptingConsolePad() |
||||
{ |
||||
PadDescriptor padDescriptor = workbench.GetPad(consolePadType); |
||||
return padDescriptor.PadContent as IScriptingConsolePad; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue