public static IEnumerable <IMetadataField> GetBehaviors(this IMetadataTypeInfo type) { IEnumerable <IMetadataField> behaviorFields = type.GetInstanceFieldsOfType(typeof(Behaves_like <>)); foreach (IMetadataField field in behaviorFields) { if (field.GetFirstGenericArgument().HasCustomAttribute(typeof(BehaviorsAttribute).FullName)) { yield return(field); } } }
public static IEnumerable <IMetadataField> GetBehaviors(this IMetadataTypeInfo type) { IEnumerable <IMetadataField> behaviorFields = type.GetInstanceFieldsOfType(new BehaviorDelegateAttributeFullName()); foreach (IMetadataField field in behaviorFields) { if (field.GetFirstGenericArgument().HasCustomAttribute(new BehaviorAttributeFullName())) { yield return(field); } } }
public static IEnumerable <IMetadataField> GetSpecifications(this IMetadataTypeInfo type) { var privateFieldsOfType = type.GetInstanceFieldsOfType <It>(); return(privateFieldsOfType); }
static IEnumerable <IMetadataField> GetInstanceFieldsOfType <T>(this IMetadataTypeInfo type) { return(type.GetInstanceFieldsOfType(typeof(T))); }
public static IEnumerable <IMetadataField> GetSpecifications(this IMetadataTypeInfo type) { var privateFieldsOfType = type.GetInstanceFieldsOfType(FullNames.AssertDelegateAttribute); return(privateFieldsOfType); }