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/GuiBuilderView.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/GuiBuilderView.cs')
-rw-r--r-- | main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs index 0a33c84717..9193618b35 100644 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs +++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs @@ -28,6 +28,7 @@ using System; +using System.Linq; using System.Collections.Generic; using System.ComponentModel; @@ -43,6 +44,7 @@ using MonoDevelop.DesignerSupport; using Gtk; using Gdk; using MonoDevelop.Ide; +using Microsoft.CodeAnalysis; namespace MonoDevelop.GtkCore.GuiBuilder { @@ -90,7 +92,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder } } - void ISupportsProjectReload.Update (Project project) + void ISupportsProjectReload.Update (MonoDevelop.Projects.Project project) { if (gproject != null && gproject.Project == project) return; @@ -101,7 +103,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder CloseDesigner (); CloseProject (); if (project != null) { - GuiBuilderWindow w = GuiBuilderDisplayBinding.GetWindow (this.ContentName); + GuiBuilderWindow w = GuiBuilderDisplayBinding.GetWindow (this.ContentName, project); if (w != null) { AttachWindow (w); if (designerStatus != null) @@ -325,16 +327,16 @@ namespace MonoDevelop.GtkCore.GuiBuilder codeBinder.UpdateSignal (args.OldSignal, args.Signal); } - public override void Save (string fileName) + public override void Save (FileSaveInformation fileSaveInformation) { - base.Save (fileName); + base.Save (fileSaveInformation); if (designer == null) return; string oldBuildFile = GuiBuilderService.GetBuildCodeFileName (gproject.Project, window.RootWidget.Name); - codeBinder.UpdateBindings (fileName); + codeBinder.UpdateBindings (fileSaveInformation.FileName); if (!ErrorMode) { if (designer != null) designer.Save (); @@ -369,12 +371,13 @@ namespace MonoDevelop.GtkCore.GuiBuilder var cls = codeBinder.GetClass (); if (cls == null) return; - foreach (var met in cls.Methods) { - if (met.Name == signal.Handler) { - ShowPage (0); - JumpTo (met.Region.BeginLine, met.Region.BeginColumn); - break; - } + var met = cls + .GetMembers (signal.Handler) + .OfType<IMethodSymbol> () + .FirstOrDefault (); + if (met != null) { + ShowPage (0); + IdeApp.ProjectOperations.JumpToDeclaration (met); } } @@ -490,7 +493,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder if (node.Reference == null) return; - ProjectReference pref; + MonoDevelop.Projects.ProjectReference pref; // If the class name includes an assembly name it means that the // widget is implemented in another assembly, not in the one that @@ -506,16 +509,16 @@ namespace MonoDevelop.GtkCore.GuiBuilder if (asm == null) return; if (gproject.Project.AssemblyContext.GetPackagesFromFullName (asm).Length > 0) { - pref = new ProjectReference (ReferenceType.Package, asm); + pref = new MonoDevelop.Projects.ProjectReference (ReferenceType.Package, asm); } else { asm = gproject.Project.AssemblyContext.GetAssemblyLocation (asm, gproject.Project.TargetFramework); - pref = new ProjectReference (ReferenceType.Assembly, asm); + pref = new MonoDevelop.Projects.ProjectReference (ReferenceType.Assembly, asm); } } else - pref = new ProjectReference (node.ReferenceType, node.Reference); + pref = new MonoDevelop.Projects.ProjectReference (node.ReferenceType, node.Reference); - foreach (ProjectReference pr in gproject.Project.References) { + foreach (var pr in gproject.Project.References) { if (pr.Reference == pref.Reference) return; } |