public LocalizedStringLengthAttribute(int minimumLength, int maximumLength) : base(maximumLength)
 {
     MinimumLength = minimumLength;
     ErrorMessage  = string.IsNullOrWhiteSpace(ErrorMessageResourceId)
         ? Resources.ErrorMessageStringLengthValidationStringFormat
         : ResourcesHelper.GetMessageFromResource(ErrorMessageResourceId);
 }
Exemplo n.º 2
0
 public LocalizedCompareAttribute(string otherPropertyName, string errorMessageResourceId) : base(otherPropertyName)
 {
     if (!string.IsNullOrEmpty(errorMessageResourceId))
     {
         ErrorMessage = ResourcesHelper.GetMessageFromResource(errorMessageResourceId);
     }
 }
Exemplo n.º 3
0
 public LocalizedRangeAttribute(double minimum, double maximum) : base(minimum, maximum)
 {
     if (string.IsNullOrEmpty(ErrorMessageResourceId))
     {
         ErrorMessage = Resources.ErrorMessageRangeValidationStringFormat;
     }
     else
     {
         ErrorMessage = ResourcesHelper.GetMessageFromResource(ErrorMessageResourceId);
     }
 }
Exemplo n.º 4
0
 public LocalizedRequiredAttribute(string resourceId = "")
 {
     if (string.IsNullOrEmpty(resourceId))
     {
         ErrorMessage = Resources.ErrorMessageRequiredValidationStringFormat;
     }
     else
     {
         ErrorMessage = ResourcesHelper.GetMessageFromResource(resourceId);
     }
 }
Exemplo n.º 5
0
 public LocalizedEmailRegularExpressionAttribute(string resourceId = "")
     : base(@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*")
 {
     if (string.IsNullOrEmpty(resourceId))
     {
         ErrorMessage = string.Format(Resources.ErrorMessageRequiredCorrectValueStringFormat, Resources.Email);
     }
     else
     {
         ErrorMessage = ResourcesHelper.GetMessageFromResource(resourceId);
     }
 }
 public LocalizedDisplayNameAttribute(string resourceId) : base(ResourcesHelper.GetMessageFromResource(resourceId))
 {
 }