예제 #1
0
 public static Type MakeGenericType(Type genericTypeDefinition, params Type[] innerTypes)
 {
     ValidationUtils.ArgumentNotNull((object)genericTypeDefinition, "genericTypeDefinition");
     ValidationUtils.ArgumentNotNullOrEmpty <Type>((ICollection <Type>)innerTypes, "innerTypes");
     ValidationUtils.ArgumentConditionTrue(TypeExtensions.IsGenericTypeDefinition(genericTypeDefinition), "genericTypeDefinition", StringUtils.FormatWith("Type {0} is not a generic type definition.", (IFormatProvider)CultureInfo.InvariantCulture, (object)genericTypeDefinition));
     return(genericTypeDefinition.MakeGenericType(innerTypes));
 }
예제 #2
0
 public static Type MakeGenericType(Type genericTypeDefinition, params Type[] innerTypes)
 {
     ValidationUtils.ArgumentNotNull(genericTypeDefinition, "genericTypeDefinition");
     ValidationUtils.ArgumentNotNullOrEmpty <Type>(innerTypes, "innerTypes");
     ValidationUtils.ArgumentConditionTrue(genericTypeDefinition.IsGenericTypeDefinition, "genericTypeDefinition", "Type {0} is not a generic type definition.".FormatWith(CultureInfo.InvariantCulture, new object[] { genericTypeDefinition }));
     return(genericTypeDefinition.MakeGenericType(innerTypes));
 }
예제 #3
0
    public static Type MakeGenericType(Type genericTypeDefinition, params Type[] innerTypes)
    {
      ValidationUtils.ArgumentNotNull(genericTypeDefinition, "genericTypeDefinition");
      ValidationUtils.ArgumentNotNullOrEmpty<Type>(innerTypes, "innerTypes");
      ValidationUtils.ArgumentConditionTrue(genericTypeDefinition.IsGenericTypeDefinition, "genericTypeDefinition", string.Format("Type {0} is not a generic type definition.", genericTypeDefinition));

      return genericTypeDefinition.MakeGenericType(innerTypes);
    }