Exemplo n.º 1
0
 /// <summary>
 /// Event handler on validation errors.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="errorEventArgs"></param>
 internal void OnValidationError(object sender, ValidationErrorEventArgs errorEventArgs)
 {
     if (errorEventArgs.ValidationErrorInfo != null)
     {
         if (this.MaxNumberOfErrors > 0 && this.Errors.Count >= this.MaxNumberOfErrors)
         {
             var eventHandler = this.MaxNumberOfErrorsEventHandler;
             if (eventHandler != null)
             {
                 eventHandler(this, null);
             }
         }
         else
         {
             this.Valid = false;
             this.Errors.Add(errorEventArgs.ValidationErrorInfo);
         }
     }
     else
     {
         System.Diagnostics.Debug.Assert(errorEventArgs.ValidationErrorInfo != null);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Event handler on validation errors.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="errorEventArgs"></param>
 internal void OnValidationError(object sender, ValidationErrorEventArgs errorEventArgs)
 {
     if (errorEventArgs.ValidationErrorInfo != null)
     {
         if (this.MaxNumberOfErrors > 0 && this.Errors.Count >= this.MaxNumberOfErrors)
         {
             var eventHandler = this.MaxNumberOfErrorsEventHandler;
             if (eventHandler != null)
             {
                 eventHandler(this, null);
             }
         }
         else
         {
             this.Valid = false;
             this.Errors.Add(errorEventArgs.ValidationErrorInfo);
         }
     }
     else
     {
         System.Diagnostics.Debug.Assert(errorEventArgs.ValidationErrorInfo != null);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Call event handler to process the error.
 /// </summary>
 /// <param name="errorEventArgs">The event argument which contains the error info.</param>
 protected virtual void OnValidationError(ValidationErrorEventArgs errorEventArgs)
 {
     var handler = this.ValidationErrorEventHandler;
     if (handler != null)
     {
         handler(this, errorEventArgs);
     }
 }