Пример #1
0
        public void Add(string name, string message)
        {
            ValidationErrorMessage validationErrorMessage;

            if (message != null)
            {
                if (_byMessage.TryGetValue(message, out validationErrorMessage))
                {
                    validationErrorMessage.ControlNames.Add(name);
                }
                else
                {
                    _byMessage[message] = new ValidationErrorMessage(name, message);
                }
            }

            if (name != null)
            {
                ValidationErrorControl validationErrorControl;

                if (_byControl.TryGetValue(name, out validationErrorControl))
                {
                    if (message != null)
                    {
                        validationErrorControl.Messages.Add(message);
                    }
                }
                else
                {
                    _byControl[name] = new ValidationErrorControl(name, message);
                }
            }
        }
Пример #2
0
        public void Add(string name, string message)
        {
            ValidationErrorMessage validationErrorMessage;

            if (message != null)
            {

                if (_byMessage.TryGetValue(message, out validationErrorMessage))
                    validationErrorMessage.ControlNames.Add(name);
                else
                    _byMessage[message] = new ValidationErrorMessage(name, message);
            }

            if (name != null)
            {
                ValidationErrorControl validationErrorControl;

                if (_byControl.TryGetValue(name, out validationErrorControl))
                {
                    if (message != null)
                        validationErrorControl.Messages.Add(message);
                }
                else
                    _byControl[name] = new ValidationErrorControl(name, message);
            }
        }