Composite Validators and CustomValidatorNodeUICommandText

Topics: Validation Application Block
Mar 27, 2008 at 10:25 AM
There is some problem with Custom Typed Validator and

Composite VAB Validators (OR, AND) - With them the custom validator's nodes (CustomValidatorNodeUICommandText) are not displayed and not listed
in context menu .... but with "Self" node or other object propertyes this CustomValidatorNodeUICommandText is displayed without problems.

Can anybody help to resolve this problem ?
Mar 31, 2008 at 3:03 PM
Edited Mar 31, 2008 at 3:05 PM
I have found the mistake ...
For example ... if the name of custom validator is "DocumentHolder" then
for CommandRegistrar class it is necessary to add the following code :

......
AddMultipleChildNodeCommand(
Resources.DocumentHolderValidatorNodeUICommandText,
Resources.DocumentHolderValidatorNodeUICommandLongText,
typeof(DocumentHolderValidatorNode),
typeof(Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.Design.ValidatorNodes.AndCompositeValidatorNode));

AddMultipleChildNodeCommand(
Resources.DocumentHolderValidatorNodeUICommandText,
Resources.DocumentHolderValidatorNodeUICommandLongText,
typeof(DocumentHolderValidatorNode),
typeof(Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.Design.ValidatorNodes.OrCompositeValidatorNode));
.....