コード例 #1
0
 public override void Validate(SAObject obj, object property)
 {
     if((property == null) || (!new Regex(RegEx).IsMatch(property.ToString())))
     {
         obj.Invalidate(ErrorMessage);
     }
 }
コード例 #2
0
 public override void Validate(SAObject obj, object property)
 {
     if(((property == null) && (MinimumLength > 0)) || (property.ToString().Length < MinimumLength))
     {
         obj.Invalidate(ErrorMessage);
     }
 }
コード例 #3
0
 public override void Validate(SAObject obj, object property)
 {
     if(property == null)
     {
         obj.Invalidate(ErrorMessage);
     }
 }
 public override void Validate(SAObject obj, object property)
 {
     if((property == null) || (String.IsNullOrWhiteSpace(property as string)))
     {
         obj.Invalidate(ErrorMessage);
     }
 }
コード例 #5
0
 public override void Validate(SAObject obj, object property)
 {
     if(property is String)
     {
         if(property.ToString().Length > MaximumLength)
         {
             obj.Invalidate(ErrorMessage);
         }
     }
 }
コード例 #6
0
 public override void Validate(SAObject obj, object property)
 {
     if(property.IsNumericType())
     {
         if((Convert.ToDouble(property) < Convert.ToDouble(MinimumValue)) || (Convert.ToDouble(property) > Convert.ToDouble(MaximumValue)))
         {
             obj.Invalidate(ErrorMessage);
         }
     }
 }
 public override void Validate(SAObject obj, object property)
 {
     if(property is String)
     {
         if(!property.ToString().All(Char.IsLetter))
         {
             obj.Invalidate(ErrorMessage);
         }
     }
 }
        public override void Validate(SAObject obj, object property)
        {
            object otherProperty = obj.GetType().GetProperty(_propertyName).GetValue(obj, null);

            if(property == null)
            {
                obj.Invalidate(ErrorMessage);
            }
            else if(property.ToString() != otherProperty.ToString())
            {
                obj.Invalidate(ErrorMessage);
            }
        }
コード例 #9
0
        public override void Validate(SAObject obj, object property)
        {
            object otherProperty = obj.GetType().GetProperty(_propertyName).GetValue(obj, null);

            if(property == null)
            {
                obj.Invalidate(ErrorMessage);
            }
            else if(Convert.ToDouble(property) >= Convert.ToDouble(otherProperty))
            {
                obj.Invalidate(ErrorMessage);
            }
        }
 public abstract void Validate(SAObject obj, object property);