예제 #1
0
        /// <inheritdoc cref="IMethodInfo.MakeGenericMethod" />
        public StaticMethodWrapper MakeGenericMethod(IList <ITypeInfo> genericArguments)
        {
            if (!IsGenericMethodDefinition)
            {
                throw new InvalidOperationException("The method is not a generic method definition.");
            }

            return(new StaticMethodWrapper(ReflectionPolicy, Handle, DeclaringType, ReflectedType, Substitution.Extend(GenericParameters, genericArguments)));
        }
        /// <inheritdoc />
        public override StaticDeclaredTypeWrapper MakeGenericType(IList <ITypeInfo> genericArguments)
        {
            if (!IsGenericTypeDefinition)
            {
                throw new InvalidOperationException("The type is not a generic type definition.");
            }

            return(new StaticDeclaredTypeWrapper(ReflectionPolicy, Handle, DeclaringType, Substitution.Extend(GenericParameters, genericArguments)));
        }