diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/ToolboxProvider.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/ToolboxProvider.cs index 149daee471..2260b563ee 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/ToolboxProvider.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/ToolboxProvider.cs @@ -136,6 +136,13 @@ namespace ICSharpCode.FormsDesigner toolboxService.SetSelectedToolboxItem(null); } + static ICompilation GetCompilationForCurrentProject() + { + IProject project = SD.ProjectService.CurrentProject; + if (project == null) return null; + return SD.ParserService.GetCompilation(project); + } + static void SelectedToolUsedHandler(object sender, EventArgs e) { SD.Log.Debug("SelectedToolUsedHandler"); @@ -148,7 +155,7 @@ namespace ICSharpCode.FormsDesigner if (selectedItem != null && selectedItem.TypeName != null) { SD.Log.Debug("Checking for reference to CustomComponent: " + selectedItem.TypeName); // Check current project has the custom component first. - ICompilation currentCompilation = SD.ParserService.GetCompilationForCurrentProject(); + ICompilation currentCompilation = GetCompilationForCurrentProject(); var typeName = new FullTypeName(selectedItem.TypeName); if (currentCompilation != null && currentCompilation.FindType(typeName).Kind == TypeKind.Unknown) { // Check other projects in the solution. diff --git a/src/Main/Base/Project/Util/SharpDevelopExtensions.cs b/src/Main/Base/Project/Util/SharpDevelopExtensions.cs index 6f320ecf9f..81e1afb7a0 100644 --- a/src/Main/Base/Project/Util/SharpDevelopExtensions.cs +++ b/src/Main/Base/Project/Util/SharpDevelopExtensions.cs @@ -902,17 +902,6 @@ namespace ICSharpCode.SharpDevelop } #endregion - #region Service Extensions - public static ICompilation GetCompilationForCurrentProject(this IParserService svc) - { - if (svc == null) - throw new ArgumentNullException("svc"); - IProject project = SD.ProjectService.CurrentProject; - if (project == null) return null; - return SD.ParserService.GetCompilation(project); - } - #endregion - #region Resource Service Extensions /// /// Gets an from a resource.