コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ValueAccessComparisonValidator"/> class.
 /// </summary>
 /// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting the comparison operand.</param>
 /// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> that specifies the kind of 
 /// comparison to perform.</param>
 /// <param name="messageTemplate">The message template to use when logging validation failures.</param>
 /// <param name="negated">Indicates if the validation logic represented by the validator should be negated.</param>
 public ValueAccessComparisonValidator(ValueAccess valueAccess,
     ComparisonOperator comparisonOperator,
     string messageTemplate,
     bool negated)
     : this(valueAccess, comparisonOperator, messageTemplate, null, negated)
 {
     this.valueAccess = valueAccess;
     this.comparisonOperator = comparisonOperator;
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ValueAccessComparisonValidator"/> class.
 /// </summary>
 /// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting the comparison operand.</param>
 /// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> that specifies the kind of
 /// comparison to perform.</param>
 /// <param name="messageTemplate">The message template to use when logging validation failures.</param>
 /// <param name="negated">Indicates if the validation logic represented by the validator should be negated.</param>
 public ValueAccessComparisonValidator(ValueAccess valueAccess,
                                       ComparisonOperator comparisonOperator,
                                       string messageTemplate,
                                       bool negated)
     : this(valueAccess, comparisonOperator, messageTemplate, null, negated)
 {
     this.valueAccess        = valueAccess;
     this.comparisonOperator = comparisonOperator;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ValueAccessComparisonValidator"/> class.
 /// </summary>
 /// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting the comparison operand.</param>
 /// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> that specifies the kind of 
 /// comparison to perform.</param>
 /// <param name="messageTemplate">The message template to use when logging validation failures.</param>
 /// <param name="tag">The tag that describes the purpose of the validator.</param>
 public ValueAccessComparisonValidator(ValueAccess valueAccess,
     ComparisonOperator comparisonOperator,
     string messageTemplate,
     string tag)
     : this(valueAccess, comparisonOperator, messageTemplate, tag, false)
 {
     this.valueAccess = valueAccess;
     this.comparisonOperator = comparisonOperator;
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ValueAccessComparisonValidator"/> class.
 /// </summary>
 /// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting the comparison operand.</param>
 /// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> that specifies the kind of
 /// comparison to perform.</param>
 /// <param name="messageTemplate">The message template to use when logging validation failures.</param>
 /// <param name="tag">The tag that describes the purpose of the validator.</param>
 public ValueAccessComparisonValidator(ValueAccess valueAccess,
                                       ComparisonOperator comparisonOperator,
                                       string messageTemplate,
                                       string tag)
     : this(valueAccess, comparisonOperator, messageTemplate, tag, false)
 {
     this.valueAccess        = valueAccess;
     this.comparisonOperator = comparisonOperator;
 }
コード例 #5
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="ValueAccessValidator"/> class with an upper bound constraint.</para>
        /// </summary>
        /// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting values from the 
        /// validated objects.</param>
        /// <param name="valueValidator">The <see cref="Validator"/> to use when validating the values extracted
        /// from the validated objects.</param>
        /// <exception cref="ArgumentNullException">when <paramref name="valueAccess"/> is <see langword="null"/>.</exception>
        /// <exception cref="ArgumentNullException">when <paramref name="valueValidator"/> is <see langword="null"/>.</exception>
        public ValueAccessValidator(ValueAccess valueAccess, Validator valueValidator)
            : base(null, null)
        {
            if (null == valueAccess)
                throw new ArgumentNullException("valueAccess");
            if (null == valueValidator)
                throw new ArgumentNullException("valueValidator");

            this.valueAccess = valueAccess;
            this.valueValidator = valueValidator;
        }
コード例 #6
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="ValueAccessValidator"/> class with an upper bound constraint.</para>
        /// </summary>
        /// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting values from the
        /// validated objects.</param>
        /// <param name="valueValidator">The <see cref="Validator"/> to use when validating the values extracted
        /// from the validated objects.</param>
        /// <exception cref="ArgumentNullException">when <paramref name="valueAccess"/> is <see langword="null"/>.</exception>
        /// <exception cref="ArgumentNullException">when <paramref name="valueValidator"/> is <see langword="null"/>.</exception>
        public ValueAccessValidator(ValueAccess valueAccess, Validator valueValidator)
            : base(null, null)
        {
            if (null == valueAccess)
            {
                throw new ArgumentNullException("valueAccess");
            }
            if (null == valueValidator)
            {
                throw new ArgumentNullException("valueValidator");
            }

            this.valueAccess    = valueAccess;
            this.valueValidator = valueValidator;
        }
コード例 #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ValueAccessComparisonValidator"/> class.
        /// </summary>
        /// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting the comparison operand.</param>
        /// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> that specifies the kind of 
        /// comparison to perform.</param>
        /// <param name="messageTemplate">The message template to use when logging validation failures.</param>
        /// <param name="tag">The tag that describes the purpose of the validator.</param>
        /// <param name="negated">Indicates if the validation logic represented by the validator should be negated.</param>
        public ValueAccessComparisonValidator(ValueAccess valueAccess,
            ComparisonOperator comparisonOperator,
            string messageTemplate,
            string tag,
            bool negated)
            : base(messageTemplate, tag, negated)
        {
            if (valueAccess == null)
            {
                throw new ArgumentNullException("valueAccess");
            }

            this.valueAccess = valueAccess;
            this.comparisonOperator = comparisonOperator;
        }
コード例 #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ValueAccessComparisonValidator"/> class.
        /// </summary>
        /// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting the comparison operand.</param>
        /// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> that specifies the kind of
        /// comparison to perform.</param>
        /// <param name="messageTemplate">The message template to use when logging validation failures.</param>
        /// <param name="tag">The tag that describes the purpose of the validator.</param>
        /// <param name="negated">Indicates if the validation logic represented by the validator should be negated.</param>
        public ValueAccessComparisonValidator(ValueAccess valueAccess,
                                              ComparisonOperator comparisonOperator,
                                              string messageTemplate,
                                              string tag,
                                              bool negated)
            : base(messageTemplate, tag, negated)
        {
            if (valueAccess == null)
            {
                throw new ArgumentNullException("valueAccess");
            }

            this.valueAccess        = valueAccess;
            this.comparisonOperator = comparisonOperator;
        }
コード例 #9
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="valueAccess"></param>
 /// <param name="validatedElement"></param>
 public ValueAccessValidatorBuilder(ValueAccess valueAccess, IValidatedElement validatedElement)
     : base(validatedElement)
 {
     this.valueAccess = valueAccess;
 }
コード例 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ValueAccessComparisonValidator"/> class.
 /// </summary>
 /// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting the comparison operand.</param>
 /// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> that specifies the kind of 
 /// comparison to perform.</param>
 public ValueAccessComparisonValidator(ValueAccess valueAccess, ComparisonOperator comparisonOperator)
     : this(valueAccess, comparisonOperator, null, null)
 { }
コード例 #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ValueAccessComparisonValidator"/> class.
 /// </summary>
 /// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting the comparison operand.</param>
 /// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> that specifies the kind of
 /// comparison to perform.</param>
 public ValueAccessComparisonValidator(ValueAccess valueAccess, ComparisonOperator comparisonOperator)
     : this(valueAccess, comparisonOperator, null, null)
 {
 }
コード例 #12
0
		/// <summary>
		/// Initializes a new instance of the <see cref="PropertyComparisonValidator"/> class.
		/// </summary>
		/// <param name="valueAccess">The <see cref="ValueAccess"/> to use to extract the value to compare.</param>
		/// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> representing the kind of comparison to perform.</param>
		/// <param name="negated">Indicates if the validation logic represented by the validator should be negated.</param>
		public PropertyComparisonValidator(ValueAccess valueAccess, ComparisonOperator comparisonOperator, bool negated)
			: base(valueAccess, comparisonOperator, null, negated)
		{ }
コード例 #13
0
		/// <summary>
		/// Initializes a new instance of the <see cref="PropertyComparisonValidator"/> class.
		/// </summary>
		/// <param name="valueAccess">The <see cref="ValueAccess"/> to use to extract the value to compare.</param>
		/// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> representing the kind of comparison to perform.</param>
		public PropertyComparisonValidator(ValueAccess valueAccess, ComparisonOperator comparisonOperator)
			: base(valueAccess, comparisonOperator)
		{ }
コード例 #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PropertyComparisonValidator"/> class.
 /// </summary>
 /// <param name="valueAccess">The <see cref="ValueAccess"/> to use to extract the value to compare.</param>
 /// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> representing the kind of comparison to perform.</param>
 /// <param name="negated">Indicates if the validation logic represented by the validator should be negated.</param>
 public PropertyComparisonValidator(ValueAccess valueAccess, ComparisonOperator comparisonOperator, bool negated)
     : base(valueAccess, comparisonOperator, null, negated)
 {
 }
コード例 #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PropertyComparisonValidator"/> class.
 /// </summary>
 /// <param name="valueAccess">The <see cref="ValueAccess"/> to use to extract the value to compare.</param>
 /// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> representing the kind of comparison to perform.</param>
 public PropertyComparisonValidator(ValueAccess valueAccess, ComparisonOperator comparisonOperator)
     : base(valueAccess, comparisonOperator)
 {
 }