public static void ProcessPublicInstancePropertiesWithSingleAttribute <T>(Type type, ForEachPropertyWithSingleAttribute <T> forEach, bool baseClassPropertiesFirst) where T : Attribute { ProcessPublicInstanceProperties(type, delegate(PropertyInfo propertyInfo) { object[] attributes = propertyInfo.GetCustomAttributes(true); T attribute = null; foreach (object curAttribute in attributes) { T assignAttribute = curAttribute as T; if (assignAttribute != null) { if (attribute != null) { return(true); // More than one, don't call delegate for any! } attribute = assignAttribute; } } if (attribute != null) { return(forEach(propertyInfo, attribute)); } return(true); }, baseClassPropertiesFirst); }
public static void ProcessPublicInstancePropertiesWithSingleAttribute <T>(Type type, ForEachPropertyWithSingleAttribute <T> forEach) where T : Attribute { ProcessPublicInstancePropertiesWithSingleAttribute <T>(type, forEach, false); }