Example #1
0
        protected internal override IList <StaticGenericParameterWrapper> GetMethodGenericParameters(StaticMethodWrapper method)
        {
            MethodDefinition methodHandle = (MethodDefinition)method.Handle;

            return(CollectionUtils.ConvertAllToArray <GenericParameter, StaticGenericParameterWrapper>(methodHandle.GenericParameters, delegate(GenericParameter parameterHandle)
            {
                return StaticGenericParameterWrapper.CreateGenericMethodParameter(this, parameterHandle, method);
            }));
        }
Example #2
0
        private StaticGenericParameterWrapper MakeGenericParameter(GenericParameter parameterHandle)
        {
            TypeReference typeHandle = parameterHandle.Owner as TypeReference;

            if (typeHandle != null)
            {
                StaticDeclaredTypeWrapper declaringType = MakeDeclaredType(typeHandle);
                return(StaticGenericParameterWrapper.CreateGenericTypeParameter(this, parameterHandle, declaringType));
            }
            else
            {
                MethodReference     methodHandle    = (MethodReference)parameterHandle.Owner;
                StaticMethodWrapper declaringMethod = WrapMethod(methodHandle);
                return(StaticGenericParameterWrapper.CreateGenericMethodParameter(this, parameterHandle, declaringMethod));
            }
        }