Exemplo n.º 1
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));
            }
        }
Exemplo n.º 2
0
 protected virtual void Visit(GenericInstanceType genericInstanceType, Context context)
 {
     this.VisitTypeReference(genericInstanceType.ElementType, context.ElementType(genericInstanceType));
     foreach (TypeReference reference in genericInstanceType.GenericArguments)
     {
         this.VisitTypeReference(reference, context.GenericArgument(genericInstanceType));
     }
 }
Exemplo n.º 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));
                }
            }
        }