예제 #1
0
 protected bool IsAutomaticallyRequired(IMemberElement element)
 {
     if (element.ForMember == null || !element.IsTextElement())
     {
         return false;
     }
     var memberType = element.ForMember.GetPropertyOrFieldType();
     if (memberType == null)
     {
         return false;
     }
     return memberType.IsValueType && !memberType.IsNullableType();
 }
예제 #2
0
        protected bool IsAutomaticallyRequired(IMemberElement element)
        {
            if (element.ForMember == null || !element.IsTextElement())
            {
                return(false);
            }
            var memberType = element.ForMember.GetPropertyOrFieldType();

            if (memberType == null)
            {
                return(false);
            }
            return(memberType.IsValueType && !memberType.IsNullableType());
        }
예제 #3
0
 protected override void DoExecute(IMemberElement element)
 {
     if (element.ForMember == null)
     {
         return;
     }
     if (!element.IsTextElement())
     {
         return;
     }
     var memberType = element.ForMember.GetPropertyOrFieldType();
     if (memberType.IsNumber())
     {
         element.AddClass(numberClass);
     }
     else if (memberType == typeof(DateTime) || memberType == typeof(DateTime?))
     {
         element.AddClass(dateClass);
     }
 }
예제 #4
0
        protected override void DoExecute(IMemberElement element)
        {
            if (element.ForMember == null)
            {
                return;
            }
            if (!element.IsTextElement())
            {
                return;
            }
            var memberType = element.ForMember.GetPropertyOrFieldType();

            if (memberType.IsNumber())
            {
                element.AddClass(numberClass);
            }
            else if (memberType == typeof(DateTime) || memberType == typeof(DateTime?))
            {
                element.AddClass(dateClass);
            }
        }