private static bool Process(MemberInfo member, IFacetHolder holder) {
     Attribute attribute = member.GetCustomAttribute<DescriptionAttribute>();
     if (attribute == null) {
         attribute = member.GetCustomAttribute<DescribedAsAttribute>();
     }
     return FacetUtils.AddFacet(Create(attribute, holder));
 }
Example #2
0
 private static bool Process(MemberInfo member, IFacetHolder holder) {
     Attribute attribute = member.GetCustomAttribute<RegularExpressionAttribute>();
     if (attribute == null) {
         attribute = member.GetCustomAttribute<RegExAttribute>();
     }
     return FacetUtils.AddFacet(Create(attribute, holder));
 }
 private static bool Process(MemberInfo member, IFacetHolder holder) {
     // give priority to Idempotent as more restrictive 
     if (member.GetCustomAttribute<IdempotentAttribute>() != null) {
         return FacetUtils.AddFacet(new IdempotentFacetAnnotation(holder));
     }
     if (member.GetCustomAttribute<QueryOnlyAttribute>() != null) {
         return FacetUtils.AddFacet(new QueryOnlyFacetAnnotation(holder));
     }
     return false;
 }
        private bool Process(MemberInfo member, Type methodReturnType, IFacetHolder holder) {
            if (CollectionUtils.IsGenericEnumerable(methodReturnType) || CollectionUtils.IsCollection(methodReturnType)) {
                var attribute = member.GetCustomAttribute<TableViewAttribute>();
                return FacetUtils.AddFacet(Create(attribute, holder));
            }

            return false;
        }
 private static bool Process(MemberInfo member, IFacetHolder holder) {
     var attribute = member.GetCustomAttribute<DisabledAttribute>();
     IDisabledFacet disabledFacet = Create(attribute, holder);
     if (disabledFacet != null) {
         return FacetUtils.AddFacet(disabledFacet);
     }
     return false;
 }
Example #6
0
        internal static string GetFieldName(System.Reflection.MemberInfo member)
        {
            string name;

            if (_fieldNameCache.TryGetValue(member, out name))
            {
                return(name);
            }

            name = member.Name;
            var columnAttribute = member.GetCustomAttribute <System.ComponentModel.DataAnnotations.ColumnAttribute>(false);

            if (columnAttribute != null)
            {
                name = columnAttribute.Name;
            }

            if (_fieldNameCache.TryAdd(member, name))
            {
                return(name);
            }
            return(_fieldNameCache[member]);
        }
 private static bool Process(MemberInfo member, IFacetHolder holder) {
     var attribute = member.GetCustomAttribute<PresentationHintAttribute>();
     return FacetUtils.AddFacet(Create(attribute, holder));
 }
Example #8
0
 private static bool Process(MemberInfo member, IFacetHolder holder) {
     var attribute = member.GetCustomAttribute<TypicalLengthAttribute>();
     return FacetUtils.AddFacet(Create(attribute, holder));
 }
Example #9
0
        private static bool Process(MemberInfo member, IFacetHolder holder) {
            Attribute attribute = member.GetCustomAttribute<StringLengthAttribute>() ?? (Attribute) member.GetCustomAttribute<MaxLengthAttribute>();

            return FacetUtils.AddFacet(Create(attribute, holder));
        }
Example #10
0
 private static bool Process(MemberInfo member, bool isDate, IFacetHolder holder) {
     var attribute = member.GetCustomAttribute<RangeAttribute>();
     return FacetUtils.AddFacet(Create(attribute, isDate, holder));
 }
 private static bool Process(MemberInfo member, IFacetHolder holder) {
     var attribute = member.GetCustomAttribute<ExcludeFromFindMenuAttribute>();
     return FacetUtils.AddFacet(Create(attribute, holder));
 }