示例#1
0
        protected override ValidationResult IsValid(object value, ValidationContext validationContext)
        {
            if (value == null)
            {
                return(ValidationResult.Success);
            }

            ICultureValidator cultureValidator = ServiceLocator.Current.GetService <ICultureValidator>();
            var result = new ValidationResult(this.ErrorMessage);

            if (cultureValidator == null)
            {
                return(result);
            }

            bool validationResult = cultureValidator.IsCultureValid(value.ToString());

            return(validationResult ? ValidationResult.Success : result);
        }
示例#2
0
 public LocalizedEnumFieldMapper(ICultureValidator cultureValidator) : base(cultureValidator)
 {
 }
 protected LocalizedStringConverter(ICultureValidator cultureValidator)
 {
     this.cultureValidator = cultureValidator;
 }
示例#4
0
 public LocalizedStringFieldMapper(ICultureValidator cultureValidator) : base(cultureValidator)
 {
 }
示例#5
0
 public LocalizedTextAttributeMapper(ICultureValidator cultureValidator) : base(cultureValidator)
 {
 }