예제 #1
0
 protected virtual void Visit(TypeReference typeReference, Context context)
 {
     if (typeReference.DeclaringType != null)
     {
         this.VisitTypeReference(typeReference.DeclaringType, context.DeclaringType(typeReference));
     }
 }
예제 #2
0
        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));
            }
        }
예제 #3
0
        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));
                }
            }
        }
예제 #4
0
 protected virtual void Visit(FieldReference fieldReference, Context context)
 {
     this.VisitTypeReference(fieldReference.FieldType, context.ReturnType(fieldReference));
     this.VisitTypeReference(fieldReference.DeclaringType, context.DeclaringType(fieldReference));
 }