/// <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); } }
public void RemoveBehavior(IValidationBehavior behavior) { behaviors.Remove(behavior); }
public void AddBehavior(IValidationBehavior behavior) { behaviors.Add(behavior, true); DoValidate(); }