protected virtual void Visit(TypeReference typeReference, Context context) { if (typeReference.DeclaringType != null) { this.VisitTypeReference(typeReference.DeclaringType, context.DeclaringType(typeReference)); } }
protected virtual void Visit(MethodReference methodReference, Context context) { VisitTypeReference(methodReference.ReturnType, context.ReturnType(methodReference)); VisitTypeReference(methodReference.DeclaringType, context.DeclaringType(methodReference)); foreach (var genericParameter in methodReference.GenericParameters) { VisitTypeReference(genericParameter, context.GenericParameter(methodReference)); } foreach (var parameterDefinition in methodReference.Parameters) { Visit(parameterDefinition, context.Parameter(methodReference)); } var genericInstanceMethod = methodReference as GenericInstanceMethod; if (genericInstanceMethod == null) { return; } foreach (var genericArgument in genericInstanceMethod.GenericArguments) { VisitTypeReference(genericArgument, context.GenericArgument(genericInstanceMethod)); } }
protected virtual void Visit(MethodReference methodReference, Context context) { this.VisitTypeReference(methodReference.ReturnType, context.ReturnType(methodReference)); this.VisitTypeReference(methodReference.DeclaringType, context.DeclaringType(methodReference)); foreach (GenericParameter parameter in methodReference.GenericParameters) { this.VisitTypeReference(parameter, context.GenericParameter(methodReference)); } foreach (ParameterDefinition definition in methodReference.Parameters) { this.Visit(definition, context.Parameter(methodReference)); } GenericInstanceMethod data = methodReference as GenericInstanceMethod; if (data != null) { foreach (TypeReference reference in data.GenericArguments) { this.VisitTypeReference(reference, context.GenericArgument(data)); } } }
protected virtual void Visit(FieldReference fieldReference, Context context) { this.VisitTypeReference(fieldReference.FieldType, context.ReturnType(fieldReference)); this.VisitTypeReference(fieldReference.DeclaringType, context.DeclaringType(fieldReference)); }