public static IEnumerable <IMetadataField> GetBehaviors(this IMetadataTypeInfo type)
        {
            IEnumerable <IMetadataField> behaviorFields = type.GetPrivateFieldsWith(typeof(Behaves_like <>));

            foreach (IMetadataField field in behaviorFields)
            {
                if (field.GetFirstGenericArgument().HasCustomAttribute(typeof(BehaviorsAttribute).FullName)
#if !RESHARPER_5
                    && field.GetFirstGenericArgument().GenericParameters.Length == 0
#endif
                    )
                {
                    yield return(field);
                }
            }
        }
 static IEnumerable <IMetadataField> GetPrivateFieldsOfType <T>(this IMetadataTypeInfo type)
 {
     return(type.GetPrivateFieldsWith(typeof(T)));
 }