public static IEnumerable <TAttribute> GetAttributes <TAttribute>(this PropertyDescriptor pd) where TAttribute : Attribute { var attributes = pd.Attributes.OfType <TAttribute>(); return(TypeExtensions.SortAttributesIfPossible(attributes)); }
public static IEnumerable <TAttribute> GetAttributes <TAttribute>(this ICustomTypeDescriptor td) where TAttribute : Attribute { var attributes = td.GetAttributes().OfType <TAttribute>(); return(TypeExtensions.SortAttributesIfPossible(attributes)); }