diff options
author | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-20 19:07:51 +0300 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-20 19:07:51 +0300 |
commit | 95408b1a41b31b645f3a8c3323ab7d3ca4bff26b (patch) | |
tree | f8f137cddcb9a40499d303be95722fd2c6081bce /main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs | |
parent | b70e4e04b4e41b8ec28d7e4b220b401ecf467e7a (diff) | |
parent | de043d330a8bf5855d4d983c804cd36727cb2406 (diff) |
Merge remote-tracking branch 'origin/roslyn' into new-project-model
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.cs | 33 |
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; } } |