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
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs')
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs33
1 files changed, 16 insertions, 17 deletions
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs
index 6b16de95e7..d3f30ee9e0 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs
@@ -37,7 +37,10 @@ using MonoDevelop.Projects;
using MonoDevelop.Projects.Text;
using MonoDevelop.GtkCore.Dialogs;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp;
+using ICSharpCode.NRefactory6.CSharp.Completion;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.GtkCore.GuiBuilder
{
@@ -107,9 +110,9 @@ namespace MonoDevelop.GtkCore.GuiBuilder
// Find the classes that could be bound to this design
var ctx = fproject.GetParserContext ();
ArrayList list = new ArrayList ();
- foreach (var cls in ctx.MainAssembly.GetAllTypeDefinitions ()) {
+ foreach (var cls in ctx.GetAllTypesInMainAssembly ()) {
if (IsValidClass (cls))
- list.Add (cls.FullName);
+ list.Add (cls.GetFullName ());
}
// Ask what to do
@@ -224,27 +227,23 @@ namespace MonoDevelop.GtkCore.GuiBuilder
}
}
- internal bool IsValidClass (IType cls)
+ internal bool IsValidClass (ITypeSymbol cls)
{
- foreach (var bt in cls.DirectBaseTypes) {
- if (bt.ReflectionName == rootWidget.Component.Type.ClassName)
- return true;
-
- var baseCls = bt;
- if (baseCls != null && IsValidClass (baseCls))
- return true;
- }
- return false;
+ if (cls.SpecialType == Microsoft.CodeAnalysis.SpecialType.System_Object)
+ return false;
+ if (cls.BaseType.GetFullName () == rootWidget.Component.Type.ClassName)
+ return true;
+ return IsValidClass (cls.BaseType);
}
}
class OpenDocumentFileProvider: ITextFileProvider
- {
- public IEditableTextFile GetEditableTextFile (FilePath filePath)
+ {
+ public ITextDocument GetEditableTextFile (FilePath filePath)
{
- foreach (Document doc in IdeApp.Workbench.Documents) {
+ foreach (var doc in IdeApp.Workbench.Documents) {
if (doc.FileName == filePath) {
- IEditableTextFile ef = doc.GetContent<IEditableTextFile> ();
+ var ef = doc.Editor;
if (ef != null) return ef;
}
}