Пример #1
0
        // TODO:
        //private static Dictionary<Form, ValidatorCollection> validators = new Dictionary<Form, ValidatorCollection>();

        public static void Register(BaseValidator validator, Form hostingForm)
        {
            // Create form bucket if it doesn't exist
            if (_validators[hostingForm] == null)
            {
                _validators[hostingForm] = new ValidatorCollection();
            }

            // Add this validator to the list of registered validators
            ValidatorCollection validators =
                (ValidatorCollection)_validators[hostingForm];

            validators.Add(validator);
        }
 public override int Add(BaseValidator x)
 {
     lock (this.m_root)
         return(m_collection.Add(x));
 }