|
|
|
@ -28,9 +28,14 @@ namespace SharpRefactoring
@@ -28,9 +28,14 @@ namespace SharpRefactoring
|
|
|
|
|
return null; |
|
|
|
|
if (!(context.ResolveResult is UnknownMethodResolveResult)) |
|
|
|
|
return null; |
|
|
|
|
if (context.ProjectContent == null) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
UnknownMethodResolveResult rr = context.ResolveResult as UnknownMethodResolveResult; |
|
|
|
|
|
|
|
|
|
if (rr.CallingClass == null) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
MenuItem item = new MenuItem() { |
|
|
|
|
Header = string.Format(StringParser.Parse("${res:AddIns.SharpRefactoring.ResolveExtensionMethod}"), rr.CallName), |
|
|
|
|
Icon = ClassBrowserIconService.GotoArrow.CreateImage() |
|
|
|
@ -38,11 +43,9 @@ namespace SharpRefactoring
@@ -38,11 +43,9 @@ namespace SharpRefactoring
|
|
|
|
|
|
|
|
|
|
List<IClass> results = new List<IClass>(); |
|
|
|
|
|
|
|
|
|
IProjectContent pc = rr.CallingClass.ProjectContent; |
|
|
|
|
|
|
|
|
|
SearchAllExtensionMethodsWithName(results, pc, rr.CallName); |
|
|
|
|
SearchAllExtensionMethodsWithName(results, context.ProjectContent, rr.CallName); |
|
|
|
|
|
|
|
|
|
foreach (IProjectContent content in pc.ReferencedContents) |
|
|
|
|
foreach (IProjectContent content in context.ProjectContent.ReferencedContents) |
|
|
|
|
SearchAllExtensionMethodsWithName(results, content, rr.CallName); |
|
|
|
|
|
|
|
|
|
if (!results.Any()) |
|
|
|
|