diff --git a/ILSpy/TreeNodes/Analyzer/AnalyzedMethodTreeNode.cs b/ILSpy/TreeNodes/Analyzer/AnalyzedMethodTreeNode.cs index 1d0308b84..5287fee95 100644 --- a/ILSpy/TreeNodes/Analyzer/AnalyzedMethodTreeNode.cs +++ b/ILSpy/TreeNodes/Analyzer/AnalyzedMethodTreeNode.cs @@ -38,7 +38,7 @@ namespace ICSharpCode.ILSpy.TreeNodes.Analyzer } public override object Text { - get { return MethodTreeNode.GetText(analyzedMethod, Language); } + get { return Language.TypeToString(analyzedMethod.DeclaringType, true) + "." + MethodTreeNode.GetText(analyzedMethod, Language); } } public override void ActivateItem(System.Windows.RoutedEventArgs e) diff --git a/ILSpy/TreeNodes/Analyzer/AnalyzedMethodUsedByTreeNode.cs b/ILSpy/TreeNodes/Analyzer/AnalyzedMethodUsedByTreeNode.cs index 72f43f6ba..28bdce99f 100644 --- a/ILSpy/TreeNodes/Analyzer/AnalyzedMethodUsedByTreeNode.cs +++ b/ILSpy/TreeNodes/Analyzer/AnalyzedMethodUsedByTreeNode.cs @@ -78,6 +78,8 @@ namespace ICSharpCode.ILSpy.TreeNodes.Analyzer IEnumerable FindReferences(LoadedAssembly asm, CancellationToken ct) { + string name = analyzedMethod.Name; + string declTypeName = analyzedMethod.DeclaringType.FullName; foreach (TypeDefinition type in TreeTraversal.PreOrder(asm.AssemblyDefinition.MainModule.Types, t => t.NestedTypes)) { ct.ThrowIfCancellationRequested(); foreach (MethodDefinition method in type.Methods) { @@ -86,8 +88,8 @@ namespace ICSharpCode.ILSpy.TreeNodes.Analyzer if (!method.HasBody) continue; foreach (Instruction instr in method.Body.Instructions) { - if (instr.Operand is MethodReference - && ((MethodReference)instr.Operand).Resolve() == analyzedMethod) { + MethodReference mr = instr.Operand as MethodReference; + if (mr != null && mr.Name == name && mr.DeclaringType.FullName == declTypeName && mr.Resolve() == analyzedMethod) { found = true; break; }