Ejemplo n.º 1
0
 // Token: 0x06001778 RID: 6008 RVA: 0x0006EF98 File Offset: 0x0006D198
 public static bool InheritsGenericDefinition(Type type, Type genericClassDefinition, out Type implementingType)
 {
     Class_517.ArgumentNotNull(type, "type");
     Class_517.ArgumentNotNull(genericClassDefinition, "genericClassDefinition");
     if (!genericClassDefinition.IsClass || !genericClassDefinition.IsGenericTypeDefinition)
     {
         throw new ArgumentNullException("'{0}' is not a generic class definition.".FormatWith(CultureInfo.InvariantCulture, genericClassDefinition));
     }
     return(Class_514.InheritsGenericDefinitionInternal(type, genericClassDefinition, out implementingType));
 }
Ejemplo n.º 2
0
 // Token: 0x06001779 RID: 6009 RVA: 0x0006EFF0 File Offset: 0x0006D1F0
 private static bool InheritsGenericDefinitionInternal(Type currentType, Type genericClassDefinition, out Type implementingType)
 {
     if (currentType.IsGenericType)
     {
         Type genericTypeDefinition = currentType.GetGenericTypeDefinition();
         if (genericClassDefinition == genericTypeDefinition)
         {
             implementingType = currentType;
             return(true);
         }
     }
     if (currentType.BaseType == null)
     {
         implementingType = null;
         return(false);
     }
     return(Class_514.InheritsGenericDefinitionInternal(currentType.BaseType, genericClassDefinition, out implementingType));
 }