I am trying to create my own custom Condition class from ICondition to do validation done by the code below, i.e. 2 regular expressions checked. Unless there would be another way of doing, but with regular OperationCondition, I end up being able to check only one reg ex. Is there a way to add more than one OperationCondition to an UltraValidator? Ohterwise, would you have a sample for creating a CustomCondition : ICondition class?
public virtual bool IsValid(out string reason) { if (CharacterValidator.IsMatch(Format)) { if (FormatValidator.IsMatch(Format)) { reason = String.Empty; return true; } else { // Invalid construct reason = Resources.Exception.FieldError_InvalidFormatSyntax; return false; } } else { // Invalid characters found reason = String.Format(Resources.Exception.FieldError_InvalidFormatCharacters, CharacterValidator.GetAllowedCharsForDisplay()); return false; } }
Thanks a lot
No further questions.
This is exactly what I needed to complete my understanding.
Thank you very much.
Hello,
I have built a sample that shows how you can implement ICondition to validate based on a complex condition. In the sample, each text editor requires that the text is formatted like an Infragistics support case number (CAS-00000-AAAAAA), and it must contain the string "ASDF".
Please let me know if you have any further questions.