Пример #1
0
 // Token: 0x06001786 RID: 6022 RVA: 0x0006F680 File Offset: 0x0006D880
 public static T GetAttribute <T>(object attributeProvider, bool inherit) where T : Attribute
 {
     T[] attributes = Class_514.GetAttributes <T>(attributeProvider, inherit);
     if (attributes == null)
     {
         return(default(T));
     }
     return(attributes.FirstOrDefault <T>());
 }
Пример #2
0
 // Token: 0x06001787 RID: 6023 RVA: 0x0006F6AC File Offset: 0x0006D8AC
 public static T[] GetAttributes <T>(object attributeProvider, bool inherit) where T : Attribute
 {
     Attribute[] attributes = Class_514.GetAttributes(attributeProvider, typeof(T), inherit);
     T[]         array      = attributes as T[];
     if (array != null)
     {
         return(array);
     }
     return(attributes.Cast <T>().ToArray <T>());
 }