Mono.Embedding.GenericServices.MakeGenericType C# (CSharp) Method

MakeGenericType() private method

private MakeGenericType ( Type type, Type typeArgs ) : IntPtr
type System.Type
typeArgs System.Type
return System.IntPtr
        public static IntPtr MakeGenericType(Type type, Type[] typeArgs)
        {
            if (type == null)
                throw new ArgumentNullException("type");

            if (typeArgs == null)
                throw new ArgumentNullException("typeArgs");

            if (!type.IsGenericTypeDefinition)
                throw new ArgumentException("Type is not a generic type definition (e.g. List`1)", "type");

            var typeParams = type.GetGenericArguments();
            if (typeParams.Length != typeArgs.Length)
                throw new ArgumentException("An invalid amount of type arguments was specified", "typeArgs");

            return type.MakeGenericType(typeArgs).TypeHandle.Value;
        }