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(); }
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()); }
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); } }