Ejemplo n.º 1
0
 /// <summary>
 /// To judge the <see cref="givenType"/> is assignable to the <see cref="TGeneric"/> or not
 /// </summary>
 /// <typeparam name="TGeneric">泛型类型</typeparam>
 /// <param name="givenType">给定类型</param>
 /// <returns></returns>
 public static bool IsGenericImplementationFor <TGeneric>(this TypeInfo givenType)
 => Types.IsGenericImplementation(givenType, typeof(TGeneric));
Ejemplo n.º 2
0
 /// <summary>
 /// To judge the <see cref="givenType"/> is assignable to the <see cref="TGeneric"/> or not
 /// </summary>
 /// <typeparam name="TGeneric">泛型类型</typeparam>
 /// <param name="givenType">给定类型</param>
 /// <returns></returns>
 public static bool IsAssignableToGenericType <TGeneric>(this TypeInfo givenType)
 => Types.IsGenericImplementation(givenType, typeof(TGeneric));
Ejemplo n.º 3
0
 /// <summary>
 /// To judge the <see cref="givenType"/> is assignable to the <see cref="genericType"/> or not
 /// </summary>
 /// <param name="givenType">给定类型</param>
 /// <param name="genericType">泛型类型</param>
 /// <returns></returns>
 public static bool IsGenericImplementationFor(this TypeInfo givenType, TypeInfo genericType)
 => Types.IsGenericImplementation(genericType, genericType);
Ejemplo n.º 4
0
 /// <summary>
 /// To judge the <see cref="givenType"/> is assignable to the <see cref="genericType"/> or not
 /// </summary>
 /// <param name="givenType">给定类型</param>
 /// <param name="genericType">泛型类型</param>
 /// <returns></returns>
 public static bool IsAssignableToGenericType(this TypeInfo givenType, TypeInfo genericType)
 => Types.IsGenericImplementation(genericType, genericType);