예제 #1
0
 public RequiredIfAttribute(string dependentProperty, Operator @operator, object dependentValue)
     : base(dependentProperty)
 {
     Operator       = @operator;
     DependentValue = dependentValue;
     Metadata       = OperatorMetadata.Get(Operator);
 }
예제 #2
0
 public IsAttribute(Operator @operator, string dependentProperty)
     : base(dependentProperty)
 {
     Operator   = @operator;
     PassOnNull = false;
     _metadata  = OperatorMetadata.Get(Operator);
 }
예제 #3
0
 public IsAttribute(Operator @operator, string dependentProperty)
     : base(dependentProperty)
 {
     Operator = @operator;
     PassOnNull = false;
     _metadata = OperatorMetadata.Get(Operator);
 }
예제 #4
0
 public MaxElementsIfAttribute(uint elements, string dependentProperty, Operator @operator, object dependentValue)
     : base(dependentProperty)
 {
     Operator       = @operator;
     DependentValue = dependentValue;
     Metadata       = OperatorMetadata.Get(Operator);
     MaxElements    = new MaxElementsAttribute(elements);
 }
예제 #5
0
        public override bool IsValid(object value, object dependentValue, object container)
        {
            if (Metadata.IsValid(dependentValue, DependentValue))
            {
                return(OperatorMetadata.Get(Operator.RegExMatch).IsValid(value, Pattern));
            }

            return(true);
        }