Exemple #1
0
        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);
                }
            }
        }
Exemple #3
0
        public static IEnumerable <IMetadataField> GetSpecifications(this IMetadataTypeInfo type)
        {
            var privateFieldsOfType = type.GetInstanceFieldsOfType <It>();

            return(privateFieldsOfType);
        }
Exemple #4
0
 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);
        }