Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 6c0d5d2

Browse files
committed
Remove weird extension method that was only used in a single place.
1 parent 904373a commit 6c0d5d2

2 files changed

Lines changed: 8 additions & 12 deletions

File tree

src/AddIns/DisplayBindings/FormsDesigner/Project/Src/ToolboxProvider.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ public static void ReloadSideTabs(bool doInsert)
136136
toolboxService.SetSelectedToolboxItem(null);
137137
}
138138

139+
static ICompilation GetCompilationForCurrentProject()
140+
{
141+
IProject project = SD.ProjectService.CurrentProject;
142+
if (project == null) return null;
143+
return SD.ParserService.GetCompilation(project);
144+
}
145+
139146
static void SelectedToolUsedHandler(object sender, EventArgs e)
140147
{
141148
SD.Log.Debug("SelectedToolUsedHandler");
@@ -148,7 +155,7 @@ static void SelectedToolUsedHandler(object sender, EventArgs e)
148155
if (selectedItem != null && selectedItem.TypeName != null) {
149156
SD.Log.Debug("Checking for reference to CustomComponent: " + selectedItem.TypeName);
150157
// Check current project has the custom component first.
151-
ICompilation currentCompilation = SD.ParserService.GetCompilationForCurrentProject();
158+
ICompilation currentCompilation = GetCompilationForCurrentProject();
152159
var typeName = new FullTypeName(selectedItem.TypeName);
153160
if (currentCompilation != null && currentCompilation.FindType(typeName).Kind == TypeKind.Unknown) {
154161
// Check other projects in the solution.

src/Main/Base/Project/Util/SharpDevelopExtensions.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -902,17 +902,6 @@ public static object GetRequiredService(this IServiceProvider provider, Type ser
902902
}
903903
#endregion
904904

905-
#region Service Extensions
906-
public static ICompilation GetCompilationForCurrentProject(this IParserService svc)
907-
{
908-
if (svc == null)
909-
throw new ArgumentNullException("svc");
910-
IProject project = SD.ProjectService.CurrentProject;
911-
if (project == null) return null;
912-
return SD.ParserService.GetCompilation(project);
913-
}
914-
#endregion
915-
916905
#region Resource Service Extensions
917906
/// <summary>
918907
/// Gets an <see cref="IImage"/> from a resource.

0 commit comments

Comments
 (0)