Ejemplo n.º 1
0
        protected internal override IList <StaticGenericParameterWrapper> GetTypeGenericParameters(StaticDeclaredTypeWrapper type)
        {
            TypeDefinition typeHandle = (TypeDefinition)type.Handle;

            return(CollectionUtils.ConvertAllToArray <GenericParameter, StaticGenericParameterWrapper>(typeHandle.GenericParameters, delegate(GenericParameter parameterHandle)
            {
                return StaticGenericParameterWrapper.CreateGenericTypeParameter(this, parameterHandle, type);
            }));
        }
Ejemplo n.º 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));
            }
        }