コード例 #1
0
 /// <summary>
 /// Creates and initializes the rule.
 /// </summary>
 /// <param name="target">Object reference containing the data to validate.</param>
 /// <param name="handler">The address of the method implementing <see cref="ValidationRuleHandler"/>.</param>
 /// <param name="args">A <see cref="ValidationRuleArgs"/> object.</param>
 public ValidationRuleInfo(object target, ValidationRuleHandler handler, ValidationRuleArgs args)
 {
     _target   = target;
     _handler  = handler;
     _args     = args;
     _ruleName = _handler.Method.Name + "!" + _args.ToString();
 }
コード例 #2
0
 /// <summary>
 /// Creates and initializes the rule.
 /// </summary>
 /// <param name="target">Object reference containing the data to validate.</param>
 /// <param name="handler">The address of the method implementing <see cref="ValidationRuleHandler"/>.</param>
 /// <param name="args">A <see cref="ValidationRuleArgs"/> object.</param>
 public ValidationRuleInfo(object target, ValidationRuleHandler handler, ValidationRuleArgs args)
 {
    _target = target;
    _handler = handler;
    _args = args;
    _ruleName = _handler.Method.Name + "!" + _args.ToString();
 }
コード例 #3
0
        /// <summary>
        /// Adds a rule to the list of validated rules.
        /// </summary>
        /// <remarks>
        /// <para>
        /// A rule is implemented by a method which conforms to the
        /// method signature defined by the <see cref="ValidationRuleHandler" /> delegate.
        /// </para>
        /// </remarks>
        /// <param name="handler">The method that implements the rule.</param>
        /// <param name="args">
        /// A <see cref="ValidationRuleArgs"/> object specifying the property name and other arguments
        /// passed to the rule method
        /// </param>
        public void AddRule(ValidationRuleHandler handler, ValidationRuleArgs args)
        {
            // get the list of rules for the property
            List <ValidationRuleInfo> list = GetPropertyRules(args.PropertyName);

            // we have the list, add our new rule
            list.Add(new ValidationRuleInfo(_target, handler, args));
        }
コード例 #4
0
 public ValidationRuleInfo(object target, ValidationRuleHandler handler, TiannuoPM.Entities.Validation.ValidationRuleArgs args)
 {
     this._ruleName = string.Empty;
     this._target   = target;
     this._handler  = handler;
     this._args     = args;
     this._ruleName = this._handler.Method.Name + "!" + this._args.ToString();
 }
コード例 #5
0
ファイル: ValidationRules.cs プロジェクト: jdaigle/nettiers
        /// <summary>
        /// Adds a rule to the list of validated rules.
        /// </summary>
        /// <remarks>
        /// <para>
        /// A rule is implemented by a method which conforms to the 
        /// method signature defined by the <see cref="ValidationRuleHandler" /> delegate.
        /// </para>
        /// </remarks>
        /// <param name="handler">The method that implements the rule.</param>
        /// <param name="args">
        /// A <see cref="ValidationRuleArgs"/> object specifying the property name and other arguments
        /// passed to the rule method
        /// </param>
        public void AddRule(ValidationRuleHandler handler, ValidationRuleArgs args)
        {
            // get the list of rules for the property
             List<ValidationRuleInfo> list = GetPropertyRules(args.PropertyName);

             // we have the list, add our new rule
             list.Add(new ValidationRuleInfo(_target, handler, args));
        }
コード例 #6
0
ファイル: ValidationRules.cs プロジェクト: jdaigle/nettiers
 /// <summary>
 /// Adds a rule to the list of validated rules.
 /// </summary>
 /// <remarks>
 /// <para>
 /// A rule is implemented by a method which conforms to the 
 /// method signature defined by the <see cref="ValidationRuleHandler" /> delegate.
 /// </para>
 /// </remarks>
 /// <param name="handler">The method that implements the rule.</param>
 /// <param name="propertyName">
 /// The name of the property on the target object where the rule implementation can retrieve
 /// the value to be validated.
 /// </param>
 public void AddRule(ValidationRuleHandler handler, string propertyName)
 {
     AddRule(handler, new ValidationRuleArgs(propertyName));
 }
コード例 #7
0
 /// <summary>
 /// Creates and initializes the rule.
 /// </summary>
 /// <param name="target">Object reference containing the data to validate.</param>
 /// <param name="handler">The address of the method implementing <see cref="ValidationRuleHandler"/>.</param>
 /// <param name="propertyName">The name of the property to which the rule applies.</param>
 public ValidationRuleInfo(object target, ValidationRuleHandler handler, string propertyName)
       :this(target, handler, new ValidationRuleArgs(propertyName))
 {
 }
コード例 #8
0
 /// <summary>
 /// Adds a rule to the list of validated rules.
 /// </summary>
 /// <remarks>
 /// <para>
 /// A rule is implemented by a method which conforms to the
 /// method signature defined by the <see cref="ValidationRuleHandler" /> delegate.
 /// </para>
 /// </remarks>
 /// <param name="handler">The method that implements the rule.</param>
 /// <param name="propertyName">
 /// The name of the property on the target object where the rule implementation can retrieve
 /// the value to be validated.
 /// </param>
 public void AddRule(ValidationRuleHandler handler, string propertyName)
 {
     AddRule(handler, new ValidationRuleArgs(propertyName));
 }
コード例 #9
0
 /// <summary>
 /// Creates and initializes the rule.
 /// </summary>
 /// <param name="target">Object reference containing the data to validate.</param>
 /// <param name="handler">The address of the method implementing <see cref="ValidationRuleHandler"/>.</param>
 /// <param name="propertyName">The name of the property to which the rule applies.</param>
 public ValidationRuleInfo(object target, ValidationRuleHandler handler, string propertyName)
     : this(target, handler, new ValidationRuleArgs(propertyName))
 {
 }
コード例 #10
0
 public ValidationRuleInfo(object target, ValidationRuleHandler handler, string propertyName) : this(target, handler, new TiannuoPM.Entities.Validation.ValidationRuleArgs(propertyName))
 {
 }
コード例 #11
0
ファイル: ValidationRules.cs プロジェクト: ishui/rms2
 public void AddRule(ValidationRuleHandler handler, ValidationRuleArgs args)
 {
     this.GetPropertyRules(args.PropertyName).Add(new ValidationRuleInfo(this._target, handler, args));
 }