private void CollectValidatorsForType(IValidatedType validatedType, List<Validator> validators)
        {
            Validator validator = CreateValidatorForValidatedElement(validatedType, this.GetCompositeValidatorBuilderForType);

            if (validator != null)
            {
                validators.Add(validator);
            }
        }
예제 #2
0
        private void CollectValidatorsForType(IValidatedType validatedType, List <Validator> validators)
        {
            Validator validator = CreateValidatorForValidatedElement(validatedType, this.GetCompositeValidatorBuilderForType);

            if (validator != null)
            {
                validators.Add(validator);
            }
        }
예제 #3
0
        void CollectValidatorsForType(IValidatedType validatedType, List <Validator> validators)
        {
            Validator item = this.CreateValidatorForValidatedElement(validatedType, new CompositeValidatorBuilderCreator(this.GetCompositeValidatorBuilderForType));

            if (item != null)
            {
                validators.Add(item);
            }
        }
예제 #4
0
        public Validator CreateValidator(IValidatedType validatedType)
        {
            List<Validator> validators = new List<Validator>();

            CollectValidatorsForType(validatedType, validators);
            CollectValidatorsForProperties(validatedType.GetValidatedProperties(), validators);
            CollectValidatorsForFields(validatedType.GetValidatedFields(), validators);
            CollectValidatorsForMethods(validatedType.GetValidatedMethods(), validators);
            CollectValidatorsForSelfValidationMethods(validatedType.GetSelfValidationMethods(), validators);

            return new AndCompositeValidator(validators.ToArray());
        }
예제 #5
0
        public Validator CreateValidator(IValidatedType validatedType)
        {
            List <Validator> validators = new List <Validator>();

            CollectValidatorsForType(validatedType, validators);
            CollectValidatorsForProperties(validatedType.GetValidatedProperties(), validators, validatedType.TargetType);
            CollectValidatorsForFields(validatedType.GetValidatedFields(), validators, validatedType.TargetType);
            CollectValidatorsForMethods(validatedType.GetValidatedMethods(), validators, validatedType.TargetType);
            CollectValidatorsForSelfValidationMethods(validatedType.GetSelfValidationMethods(), validators);

            return(new AndCompositeValidator(validators.ToArray()));
        }
예제 #6
0
 public Validator CreateValidator(IValidatedType validatedType)
 {
     List<Validator> validators = new List<Validator>();
     this.CollectValidatorsForType(validatedType, validators);
     this.CollectValidatorsForProperties(validatedType.GetValidatedProperties(), validators, validatedType.TargetType);
     this.CollectValidatorsForFields(validatedType.GetValidatedFields(), validators, validatedType.TargetType);
     this.CollectValidatorsForMethods(validatedType.GetValidatedMethods(), validators, validatedType.TargetType);
     this.CollectValidatorsForSelfValidationMethods(validatedType.GetSelfValidationMethods(), validators);
     if (validators.Count == 1)
     {
         return validators[0];
     }
     return new AndCompositeValidator(validators.ToArray());
 }
예제 #7
0
        public Validator CreateValidator(IValidatedType validatedType)
        {
            List <Validator> list = new List <Validator>();

            this.CollectValidatorsForType(validatedType, list);
            this.CollectValidatorsForProperties(validatedType.GetValidatedProperties(), list, validatedType.TargetType);
            this.CollectValidatorsForFields(validatedType.GetValidatedFields(), list, validatedType.TargetType);
            this.CollectValidatorsForMethods(validatedType.GetValidatedMethods(), list, validatedType.TargetType);
            this.CollectValidatorsForSelfValidationMethods(validatedType.GetSelfValidationMethods(), list);
            if (list.Count == 1)
            {
                return(list[0]);
            }
            return(new AndCompositeValidator(list.ToArray()));
        }
예제 #8
0
        public Validator CreateValidator(IValidatedType validatedType)
        {
            var validators = new List <Validator>();

            CollectValidatorsForType(validatedType, validators);
            CollectValidatorsForProperties(validatedType.GetValidatedProperties(), validators);
            CollectValidatorsForFields(validatedType.GetValidatedFields(), validators);
            CollectValidatorsForMethods(validatedType.GetValidatedMethods(), validators);
            CollectValidatorsForSelfValidationMethods(validatedType.GetSelfValidationMethods(), validators);

            if (validators.Count == 1)
            {
                return(validators[0]);
            }
            return(new AndCompositeValidator(validators.ToArray()));
        }
예제 #9
0
 public void Setup()
 {
     this.validatedType = new ValidationAttributeValidatedType(typeof(TypeWithValidationAttributes));
 }
예제 #10
0
 void CollectValidatorsForType(IValidatedType validatedType, List<Validator> validators)
 {
     Validator item = this.CreateValidatorForValidatedElement(validatedType, new CompositeValidatorBuilderCreator(this.GetCompositeValidatorBuilderForType));
     if (item != null)
     {
         validators.Add(item);
     }
 }