示例#1
0
        public static IEnumerable <TAttribute> GetAttributes <TAttribute>(this PropertyDescriptor pd) where TAttribute : Attribute
        {
            var attributes = pd.Attributes.OfType <TAttribute>();

            return(TypeExtensions.SortAttributesIfPossible(attributes));
        }
示例#2
0
        public static IEnumerable <TAttribute> GetAttributes <TAttribute>(this ICustomTypeDescriptor td) where TAttribute : Attribute
        {
            var attributes = td.GetAttributes().OfType <TAttribute>();

            return(TypeExtensions.SortAttributesIfPossible(attributes));
        }