Exemple #1
0
        public static T GetCustomAttribute <T>(this IPropertyDescriptor me, bool inherit = true) where T : Attribute
        {
            var attributes = me.GetCustomAttributes(typeof(T), inherit);

            if (attributes == null || attributes.Length == 0)
            {
                return(null);
            }
            return((T)attributes[0]);
        }
Exemple #2
0
 public T[] GetCustomAttributes <T>(bool inherit = true) where T : Attribute
 {
     return(holder.GetCustomAttributes <T>(inherit));
 }