|
|
@ -71,9 +71,9 @@ namespace ICSharpCode.ILSpy.TreeNodes.Analyzer |
|
|
|
{ |
|
|
|
{ |
|
|
|
var property = method.DeclaringType.Properties.FirstOrDefault(p => p.GetMethod == method || p.SetMethod == method); |
|
|
|
var property = method.DeclaringType.Properties.FirstOrDefault(p => p.GetMethod == method || p.SetMethod == method); |
|
|
|
if (property != null) |
|
|
|
if (property != null) |
|
|
|
return new AnalyzedPropertyTreeNode(property) {Language = Language}; |
|
|
|
return new AnalyzedPropertyTreeNode(property) { Language = Language }; |
|
|
|
|
|
|
|
|
|
|
|
return new AnalyzedMethodTreeNode(method) {Language = Language}; |
|
|
|
return new AnalyzedMethodTreeNode(method) { Language = Language }; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private bool IsUsedInTypeReferences(IEnumerable<TypeReference> types) |
|
|
|
private bool IsUsedInTypeReferences(IEnumerable<TypeReference> types) |
|
|
@ -93,9 +93,9 @@ namespace ICSharpCode.ILSpy.TreeNodes.Analyzer |
|
|
|
private bool IsUsedInTypeDefinition(TypeDefinition type) |
|
|
|
private bool IsUsedInTypeDefinition(TypeDefinition type) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return IsUsedInTypeReference(type) |
|
|
|
return IsUsedInTypeReference(type) |
|
|
|
|| TypeMatches(type.BaseType) |
|
|
|
|| TypeMatches(type.BaseType) |
|
|
|
|| IsUsedInTypeReferences(type.Interfaces) |
|
|
|
|| IsUsedInTypeReferences(type.Interfaces) |
|
|
|
|| IsUsedInCustomAttributes(type.CustomAttributes); |
|
|
|
|| IsUsedInCustomAttributes(type.CustomAttributes); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private bool IsUsedInFieldReference(FieldReference field) |
|
|
|
private bool IsUsedInFieldReference(FieldReference field) |
|
|
@ -126,8 +126,8 @@ namespace ICSharpCode.ILSpy.TreeNodes.Analyzer |
|
|
|
private bool IsUsedInMethodDefinition(MethodDefinition method) |
|
|
|
private bool IsUsedInMethodDefinition(MethodDefinition method) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return IsUsedInMethodReference(method) |
|
|
|
return IsUsedInMethodReference(method) |
|
|
|
|| IsUsedInMethodBody(method.Body) |
|
|
|
|| IsUsedInMethodBody(method.Body) |
|
|
|
|| IsUsedInCustomAttributes(method.CustomAttributes); |
|
|
|
|| IsUsedInCustomAttributes(method.CustomAttributes); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private bool IsUsedInMethodBody(MethodBody body) |
|
|
|
private bool IsUsedInMethodBody(MethodBody body) |
|
|
@ -148,7 +148,7 @@ namespace ICSharpCode.ILSpy.TreeNodes.Analyzer |
|
|
|
private bool IsUsedInMethodParameter(ParameterDefinition parameter) |
|
|
|
private bool IsUsedInMethodParameter(ParameterDefinition parameter) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return TypeMatches(parameter.ParameterType) |
|
|
|
return TypeMatches(parameter.ParameterType) |
|
|
|
|| IsUsedInCustomAttributes(parameter.CustomAttributes); |
|
|
|
|| IsUsedInCustomAttributes(parameter.CustomAttributes); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private bool IsUsedInCustomAttributes(IEnumerable<CustomAttribute> attributes) |
|
|
|
private bool IsUsedInCustomAttributes(IEnumerable<CustomAttribute> attributes) |
|
|
|