Example #1
0
 /// <summary>
 /// Add a <see cref="IValidationBehavior"/> to the Console. The default behavior is <see cref="StandardBehaviour"/>. The console can manage a collection of behaviors
 /// </summary>
 /// <param name="behavior"><see cref="IValidationBehavior"/> to add</param>
 /// <remarks>This method is a shortcut for adding from the <see cref="ValidationBehaviours"/> collection</remarks>
 public void AddValidationBehavior(IValidationBehavior behavior)
 {
     if (!ValidationBehaviours.Any(x => x.GetType() == behavior.GetType()))
     {
         ValidationBehaviours.Add(behavior);
     }
 }
Example #2
0
 public void RemoveBehavior(IValidationBehavior behavior)
 {
     behaviors.Remove(behavior);
 }
Example #3
0
 public void AddBehavior(IValidationBehavior behavior)
 {
     behaviors.Add(behavior, true);
     DoValidate();
 }