CustomValidator¶
This function delegate is the active method-mode custom validation hook used by clsCustomValidator, letting caller code inspect the validator instance itself and decide whether the current validation pass should fail. The binder uses it when validation needs access to both configuration and accumulated state on the validator rather than just the raw bound object.
Purpose¶
- Provides the active function-style callback contract for method-mode custom validation registration.
- Allows validator logic to inspect
clsCustomValidatorstate, including bound source, configured property, control association, and error collection, before reporting success or failure.
Context¶
- Namespace:
SAIF.Presentation.Web.Binding - Assembly/package:
SAIF.Presentation.Web.Binding.Infragistics103(embedded/bundled as source, not independently packaged)
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| CustomValidator | Public Delegate Function CustomValidator(ByRef inValidator As clsCustomValidator) As Boolean |
Invoked by clsCustomValidator.PerformValidation() when ValidationType is Method, receiving the validator instance itself; the callback should return False to cause the validator to flag an error condition for the current validation pass. |
Behavioral notes¶
clsObjectBindManager.AddCustomValidator(inControl, target, validationMethod)stores this delegate inMethodValidationDelegateand marks the validator as method-mode.- When the callback returns
False,clsCustomValidator.PerformValidation()setsm_Errors = Truebefore control formatting and message aggregation continue.
Constraints and usage notes¶
- Returning
Falsereports failure; callers that also need message text must populate the validator's error collection through the validator instance or surrounding validation flow. - This method-mode path is separate from property-mode validation and does not use the
MethodValidatordelegate type.
Sources¶
SAIF.Presentation.Web.Binding.Infragistics103\Enums.vbSAIF.Presentation.Web.Binding.Infragistics103\clsCustomValidator.vbSAIF.Presentation.Web.Binding.Infragistics103\clsObjectBindManager.vb