Validator Add Method (TextBox, Label)CleanCode C# Libraries v1.2.03 API
Adds the specified OnlineTextBox and its associated error label to the list of form fields to validate.

Namespace: CleanCode.Forms
Assembly: CleanCode (in CleanCode.dll) Version: 1.2.3.0 (1.2.03)
Syntax

public void Add(
	TextBox textBox,
	Label errLabel
)
Exceptions

ExceptionCondition
OnlineSystem NullReferenceException if an added Control does not have a Tag property defined.
OnlineSystem ArgumentException if a pattern attribute has an invalid regular expression.
OnlineSystem FormatException if any of the attributes that take numbers do not have a numerical argument.
Remarks

Each added control must have a Tag property as described in the class description, otherwise a NullReferenceException will be thrown. Once all form controls to be validated are added with this method, then call ValidateAll  to validate all initial values, activate/deactivate error messages, and disable/enable the form's OK button. The OK button will only be enabled if all validated fields pass validation.
See Also