Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorLluis Sanchez <llsan@microsoft.com>2019-02-18 11:39:34 +0300
committerLluis Sanchez <llsan@microsoft.com>2019-02-18 15:16:03 +0300
commit6a6a987906189657863d9f5cf644425af71597c1 (patch)
tree5502dbf748d8dffe3b657bdb3d23ca56e3999745 /main/src
parentbeefb16bf980e0c843312969cde2e9a0eebe8bc3 (diff)
Migrate tests to the new testing infrastructure
Diffstat (limited to 'main/src')
-rw-r--r--main/src/addins/AspNet/Tests/Razor/RazorParserTests.cs32
-rw-r--r--main/src/addins/AspNet/Tests/WebForms/WebFormsTesting.cs25
-rw-r--r--main/src/addins/AspNet/WebForms/ILanguageCompletionBuilder.cs17
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentEngine.cs7
-rw-r--r--main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Tests/MonoDevelop.AspNetCore.Tests/PublishProfileTests.cs18
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/BasicTests.cs8
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/TestResultBuilderTests.cs3
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/UnitTestGroupTests.cs3
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/VsTestUnitTestTests.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs236
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs121
11 files changed, 46 insertions, 427 deletions
diff --git a/main/src/addins/AspNet/Tests/Razor/RazorParserTests.cs b/main/src/addins/AspNet/Tests/Razor/RazorParserTests.cs
index fc714ebaf8..4e02e75af2 100644
--- a/main/src/addins/AspNet/Tests/Razor/RazorParserTests.cs
+++ b/main/src/addins/AspNet/Tests/Razor/RazorParserTests.cs
@@ -31,7 +31,9 @@ using Microsoft.CodeAnalysis.CSharp.Syntax;
using MonoDevelop.AspNet.Razor;
using MonoDevelop.Core.Text;
using MonoDevelop.Ide;
+using MonoDevelop.Ide.Editor;
using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.Gui.Documents;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Projects;
using NUnit.Framework;
@@ -47,7 +49,10 @@ namespace MonoDevelop.AspNet.Tests.Razor
[TearDown]
public override void TearDown ()
{
- TypeSystemServiceTestExtensions.UnloadSolution (solution);
+ if (solution != null) {
+ TypeSystemServiceTestExtensions.UnloadSolution (solution);
+ solution.Dispose ();
+ }
base.TearDown ();
}
@@ -75,16 +80,9 @@ namespace MonoDevelop.AspNet.Tests.Razor
projectFile.Generator = "RazorTemplatePreprocessor";
var sev = new TestViewContent ();
- sev.Project = project;
- sev.ContentName = file;
+ await sev.Initialize (new FileDescriptor (file, null, project), null);
sev.Text = text;
-
- var tww = new TestWorkbenchWindow ();
- tww.ViewContent = sev;
-
- var doc = new TestDocument (tww);
- doc.Editor.FileName = sev.ContentName;
- doc.UpdateProject (project);
+ sev.Editor.FileName = sev.FilePath;
solution = new MonoDevelop.Projects.Solution ();
solution.DefaultSolutionFolder.AddItem (project);
@@ -92,7 +90,7 @@ namespace MonoDevelop.AspNet.Tests.Razor
await TypeSystemServiceTestExtensions.LoadSolution (solution);
var parser = new RazorTestingParser {
- Doc = doc
+ Editor = sev.Editor
};
var options = new ParseOptions {
Project = project,
@@ -102,5 +100,17 @@ namespace MonoDevelop.AspNet.Tests.Razor
return (RazorCSharpParsedDocument)parser.Parse (options, default(CancellationToken)).Result;
}
}
+
+ public class RazorTestingParser : RazorCSharpParser
+ {
+ public TextEditor Editor { get; set; }
+
+ public override System.Threading.Tasks.Task<ParsedDocument> Parse (ParseOptions parseOptions, System.Threading.CancellationToken cancellationToken)
+ {
+ Editor.FileName = parseOptions.FileName;
+ OpenDocuments.Add (new OpenRazorDocument (Editor));
+ return base.Parse (parseOptions, cancellationToken);
+ }
+ }
}
diff --git a/main/src/addins/AspNet/Tests/WebForms/WebFormsTesting.cs b/main/src/addins/AspNet/Tests/WebForms/WebFormsTesting.cs
index a27a72e24f..29edd623d8 100644
--- a/main/src/addins/AspNet/Tests/WebForms/WebFormsTesting.cs
+++ b/main/src/addins/AspNet/Tests/WebForms/WebFormsTesting.cs
@@ -32,6 +32,8 @@ using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Projects;
+using MonoDevelop.Ide.Gui.Documents;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.Tests.WebForms
{
@@ -89,27 +91,26 @@ namespace MonoDevelop.AspNet.Tests.WebForms
project.AddFile (file);
sev = new TestViewContent ();
- sev.Project = project;
- sev.ContentName = file;
+ await sev.Initialize (new FileDescriptor (file, null, project), null);
+
sev.Text = editorText;
sev.CursorPosition = cursorPosition;
- var tww = new TestWorkbenchWindow ();
- tww.ViewContent = sev;
-
- var doc = new TestDocument (tww);
- doc.Editor.FileName = sev.ContentName;
var parser = new WebFormsParser ();
var options = new ParseOptions {
Project = project,
- FileName = sev.ContentName,
+ FileName = file,
Content = new StringTextSource (parsedText)
};
+ sev.Editor.FileName = sev.FilePath;
+
var parsedDoc = await parser.Parse (options, default(CancellationToken)) as WebFormsParsedDocument;
- doc.HiddenParsedDocument = parsedDoc;
+
+ var documentContext = sev.GetContent<RoslynDocumentContext> ();
+ documentContext.SetParsedDocument (parsedDoc);
return new CreateEditorResult {
- Extension = new WebFormsTestingEditorExtension (doc),
+ Extension = new WebFormsTestingEditorExtension (sev.Editor, documentContext),
EditorText = editorText,
ViewContent = sev
};
@@ -117,9 +118,9 @@ namespace MonoDevelop.AspNet.Tests.WebForms
public class WebFormsTestingEditorExtension : WebFormsEditorExtension
{
- public WebFormsTestingEditorExtension (Document doc)
+ public WebFormsTestingEditorExtension (TextEditor editor, DocumentContext documentContext)
{
- Initialize (doc.Editor, doc);
+ Initialize (editor, documentContext);
}
public CodeCompletionContext GetCodeCompletionContext (TestViewContent sev)
diff --git a/main/src/addins/AspNet/WebForms/ILanguageCompletionBuilder.cs b/main/src/addins/AspNet/WebForms/ILanguageCompletionBuilder.cs
index 41a22f1779..abe4f016af 100644
--- a/main/src/addins/AspNet/WebForms/ILanguageCompletionBuilder.cs
+++ b/main/src/addins/AspNet/WebForms/ILanguageCompletionBuilder.cs
@@ -47,8 +47,7 @@ namespace MonoDevelop.AspNet.WebForms
public ParsedDocument ParsedLocalDocument { get; set; }
public int CaretPosition { get; set; }
public int OriginalCaretPosition { get; set; }
- public HiddenDocument HiddenDocument { get; set; }
-
+
public List<OffsetInfo> OffsetInfos = new List<OffsetInfo> ();
public class OffsetInfo
@@ -207,18 +206,4 @@ namespace MonoDevelop.AspNet.WebForms
return null;
}
}
-
- public class HiddenDocument : MonoDevelop.Ide.Gui.Document
- {
- internal ParsedDocument HiddenParsedDocument;
- public override ParsedDocument ParsedDocument {
- get {
- return HiddenParsedDocument;
- }
- }
-
- public HiddenDocument (MonoDevelop.Ide.Gui.IWorkbenchWindow window) : base(window)
- {
- }
- }
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentEngine.cs b/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentEngine.cs
index 3294fa2c4d..968adc6dd6 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentEngine.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentEngine.cs
@@ -37,7 +37,6 @@ namespace MonoDevelop.JSon
class JSonIndentEngine : IStateMachineIndentEngine
{
TextEditor editor;
- DocumentContext ctx;
int offset, line, column;
internal int thisLineIndent, nextLineIndent;
StringBuilder currentIndent;
@@ -46,21 +45,17 @@ namespace MonoDevelop.JSon
bool isLineStart;
bool isInString;
- public JSonIndentEngine (TextEditor editor, DocumentContext ctx)
+ public JSonIndentEngine (TextEditor editor)
{
if (editor == null)
throw new ArgumentNullException ("editor");
- if (ctx == null)
- throw new ArgumentNullException ("ctx");
this.editor = editor;
- this.ctx = ctx;
Reset ();
}
JSonIndentEngine (JSonIndentEngine jSonIndentEngine)
{
this.editor = jSonIndentEngine.editor;
- this.ctx = jSonIndentEngine.ctx;
this.offset = jSonIndentEngine.offset;
this.line = jSonIndentEngine.line;
this.column = jSonIndentEngine.column;
diff --git a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Tests/MonoDevelop.AspNetCore.Tests/PublishProfileTests.cs b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Tests/MonoDevelop.AspNetCore.Tests/PublishProfileTests.cs
index 85bb331d83..b99c63db14 100644
--- a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Tests/MonoDevelop.AspNetCore.Tests/PublishProfileTests.cs
+++ b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Tests/MonoDevelop.AspNetCore.Tests/PublishProfileTests.cs
@@ -1,4 +1,4 @@
-//
+//
// PublishProfileTests.cs
//
// Author:
@@ -40,16 +40,9 @@ using MonoDevelop.Core;
namespace MonoDevelop.AspNetCore.Tests
{
[TestFixture]
- class PublishProfileTests
+ [RequireService(typeof(RootWorkspace))]
+ class PublishProfileTests: TestBase
{
- [SetUp]
- public void SetUp ()
- {
- DesktopService.Initialize ();
- if (!IdeApp.IsInitialized)
- IdeApp.Initialize (new ProgressMonitor ());
- }
-
[TestCase ("Debug", "Any CPU", "netcoreapp2.0", "bin/Debug/netcoreapp2.0/publish")]
[TestCase ("Release", "x86", "netcoreapp2.1", "bin/Debug/netcoreapp2.1/publish")]
public void PublishProfilesCanBeRead (string configuration, string platform, string targetFramework, string publishDir)
@@ -87,16 +80,13 @@ namespace MonoDevelop.AspNetCore.Tests
//if there is NOT a Release configuration id, the expected relative path should follow: "bin/<CurrentActiveConfig>/<netcore-version>/publish"
project.Configurations.Remove ("Release");
- IdeApp.Workspace.ActiveConfigurationId = "Debug";
+ IdeServices.Workspace.ActiveConfigurationId = "Debug";
expected = $"bin/{project.GetActiveConfiguration ()}/{GetShortFrameworkIdentifier (project.TargetFramework.Id)}/publish";
Assert.That (resolver.GetDefaultFolder (UriKind.Relative) == expected);
solution.Dispose ();
}
- [TearDown]
- public async Task TearDown () => await IdeApp.Workspace.Close ();
-
string GetShortFrameworkIdentifier (TargetFrameworkMoniker framework)
{
string shortFrameworkIdentifier = framework.Identifier;
diff --git a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/BasicTests.cs b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/BasicTests.cs
index 7cf847e987..150248ee3e 100644
--- a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/BasicTests.cs
+++ b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/BasicTests.cs
@@ -35,14 +35,6 @@ namespace MonoDevelop.UnitTesting.Tests
{
Solution sol;
- [TestFixtureSetUp]
- public void Start()
- {
- DesktopService.Initialize();
- IdeApp.Initialize(new ProgressMonitor());
- IdeApp.Workspace.ActiveConfigurationId = "Debug";
- }
-
[TearDown]
public override void TearDown ()
{
diff --git a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/TestResultBuilderTests.cs b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/TestResultBuilderTests.cs
index 0a764153c9..cb4a794837 100644
--- a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/TestResultBuilderTests.cs
+++ b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/TestResultBuilderTests.cs
@@ -31,11 +31,12 @@ using MonoDevelop.Core.Execution;
using MonoDevelop.Projects;
using MonoDevelop.UnitTesting.VsTest;
using NUnit.Framework;
+using UnitTests;
namespace MonoDevelop.UnitTesting.Tests
{
[TestFixture]
- public class TestResultBuilderTests
+ public class TestResultBuilderTests : TestBase
{
TestResultBuilder builder;
TestContext context;
diff --git a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/UnitTestGroupTests.cs b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/UnitTestGroupTests.cs
index 42d4f93ed8..3ffd37a62e 100644
--- a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/UnitTestGroupTests.cs
+++ b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/UnitTestGroupTests.cs
@@ -29,11 +29,12 @@ using System.Linq;
using MonoDevelop.Core.Execution;
using MonoDevelop.Projects;
using NUnit.Framework;
+using UnitTests;
namespace MonoDevelop.UnitTesting.Tests
{
[TestFixture]
- public class UnitTestGroupTests
+ public class UnitTestGroupTests : TestBase
{
[Test]
public void TestStatusUpdateCount ()
diff --git a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/VsTestUnitTestTests.cs b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/VsTestUnitTestTests.cs
index eb3a3f208c..a0748216f1 100644
--- a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/VsTestUnitTestTests.cs
+++ b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/VsTestUnitTestTests.cs
@@ -28,11 +28,12 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using MonoDevelop.UnitTesting.VsTest;
using NUnit.Framework;
using System;
+using UnitTests;
namespace MonoDevelop.UnitTesting.Tests
{
[TestFixture]
- class VsTestUnitTestTests
+ class VsTestUnitTestTests : TestBase
{
VsTestUnitTest CreateVsUnitTest (string fullyQualifiedName)
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs
deleted file mode 100644
index 0bfd0a0563..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs
+++ /dev/null
@@ -1,236 +0,0 @@
-//
-// HiddenTextEditorViewContent.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Components;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Editor;
-using MonoDevelop.Core.Text;
-using System.Threading.Tasks;
-
-namespace MonoDevelop.Ide.Gui
-{
- public class HiddenTextEditorViewContent : MonoDevelop.Ide.Gui.ViewContent, IServiceProvider
- {
- readonly TextEditor editor;
-
- public TextEditor Editor {
- get {
- return editor;
- }
- }
-
- public override Control Control {
- get {
- return null;
- }
- }
-
- public HiddenTextEditorViewContent ()
- {
- editor = TextEditorFactory.CreateNewEditor ();
- Name = "";
- }
-
- public HiddenTextEditorViewContent (TextEditor editor)
- {
- this.editor = editor;
- Name = editor.FileName;
- }
-
- public FilePath Name {
- get;
- set;
- }
-
- public bool HasInputFocus {
- get { return false; }
- }
-
- public int LineCount {
- get {
- return editor.LineCount;
- }
- }
-
- public string Text {
- get {
- return editor.Text;
- }
- set {
- editor.Text = value;
- }
- }
-
- public int InsertText (int position, string text)
- {
- editor.InsertText (position, text);
- return text.Length;
- }
-
- public void DeleteText (int position, int length)
- {
- editor.ReplaceText (position, length, "");
- }
-
- public int Length {
- get {
- return editor.Length;
- }
- }
-
- public string GetText (int startPosition, int endPosition)
- {
- return editor.GetTextBetween (startPosition, endPosition);
- }
- public char GetCharAt (int position)
- {
- return editor.GetCharAt (position);
- }
-
- public int GetPositionFromLineColumn (int line, int column)
- {
- return editor.LocationToOffset (line, column);
- }
-
- public void GetLineColumnFromPosition (int position, out int line, out int column)
- {
- var loc = editor.OffsetToLocation (position);
- line = loc.Line;
- column = loc.Column;
- }
-
- public string SelectedText { get { return ""; } set { } }
-
- public int CursorPosition {
- get {
- return editor.CaretOffset;
- }
- set {
- editor.CaretOffset = value;
- }
- }
-
- public int SelectionStartPosition {
- get {
- if (!editor.IsSomethingSelected)
- return editor.CaretOffset;
- return editor.SelectionRange.Offset;
- }
- }
-
- public int SelectionEndPosition {
- get {
- if (!editor.IsSomethingSelected)
- return editor.CaretOffset;
- return editor.SelectionRange.EndOffset;
- }
- }
-
- public void Select (int startPosition, int endPosition)
- {
- editor.SelectionRange = new TextSegment (startPosition, endPosition - startPosition);
- }
-
- public void ShowPosition (int position)
- {
- }
-
- public bool EnableUndo {
- get {
- return false;
- }
- }
- public bool EnableRedo {
- get {
- return false;
- }
- }
-
- public void SetCaretTo (int line, int column)
- {
- }
- public void SetCaretTo (int line, int column, bool highlightCaretLine)
- {
- }
- public void SetCaretTo (int line, int column, bool highlightCaretLine, bool centerCaretLine)
- {
- }
-
- public void Undo()
- {
- }
- public void Redo()
- {
- }
-
- class DisposeStub : IDisposable
- {
- public void Dispose ()
- {
- }
- }
-
- public void RunWhenLoaded (System.Action action)
- {
- action ();
- }
-
- public IDisposable OpenUndoGroup ()
- {
- return new DisposeStub ();
- }
-
- #region IServiceProvider implementation
-
- object IServiceProvider.GetService (Type serviceType)
- {
- if (serviceType.IsInstanceOfType (editor))
- return editor;
- return null;
- }
-
- #endregion
-
- public event EventHandler CaretPositionSet;
-
- protected virtual void OnCaretPositionSet (EventArgs e)
- {
- var handler = CaretPositionSet;
- if (handler != null)
- handler (this, e);
- }
-
- protected override object OnGetContent (Type type)
- {
- if (type.IsAssignableFrom (typeof(TextEditor)))
- return Editor;
- else
- return base.OnGetContent (type);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs
deleted file mode 100644
index b5e3110a4e..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// HiddenWorkbenchWindow.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using Mono.Addins;
-
-namespace MonoDevelop.Ide.Gui
-{
- public class HiddenWorkbenchWindow : MonoDevelop.Ide.Gui.IWorkbenchWindow
- {
- string title;
- public string Title {
- get {
- return title;
- }
- set {
- title = value;
- }
- }
-
- public string DocumentType {
- get { return ""; }
- set {}
- }
-
- public MonoDevelop.Ide.Gui.Document Document {
- get;
- set;
- }
-
- public bool ShowNotification {
- get { return false; }
- set {}
- }
-
- public ExtensionContext ExtensionContext {
- get { return AddinManager.AddinEngine; }
- }
-
- MonoDevelop.Ide.Gui.ViewContent viewContent;
- public MonoDevelop.Ide.Gui.ViewContent ViewContent {
- get { return viewContent; }
- set { viewContent = value; }
- }
-
- public IEnumerable<BaseViewContent> SubViewContents { get { return new BaseViewContent[0]; } }
-
- public MonoDevelop.Ide.Gui.BaseViewContent ActiveViewContent {
- get { return ViewContent;}
- set {}
- }
-
- public Task<bool> CloseWindow (bool force)
- {
- return Task.FromResult (true);
- }
-
- public void SelectWindow ()
- {
- }
-
- public void SwitchView (int viewNumber)
- {
- }
- public void SwitchView (MonoDevelop.Ide.Gui.BaseViewContent subViewContent)
- {
- }
-
- public int FindView<T> ()
- {
- return -1;
- }
-
- public void AttachViewContent (MonoDevelop.Ide.Gui.BaseViewContent subViewContent)
- {
-
- }
-
- public void InsertViewContent (int index, MonoDevelop.Ide.Gui.BaseViewContent subViewContent)
- {
-
- }
-
- public DocumentToolbar GetToolbar (BaseViewContent targetView)
- {
- return null;
- }
-
- public event EventHandler TitleChanged { add {} remove {} }
- public event EventHandler DocumentChanged { add {} remove {} }
- public event MonoDevelop.Ide.Gui.WorkbenchWindowAsyncEventHandler Closing { add {} remove {} }
- public event MonoDevelop.Ide.Gui.WorkbenchWindowEventHandler Closed { add {} remove {} }
- public event MonoDevelop.Ide.Gui.ActiveViewContentEventHandler ActiveViewContentChanged { add {} remove {} }
- public event EventHandler ViewsChanged { add {} remove {} }
- }
-}