Пример #1
0
        public override void Validate(Dictionary <string, Dictionary <string, string> > validationMessages)
        {
            if (this.ValidationSetting == null ||
                this.ValidationSetting.Validators == null ||
                this.ValidationSetting.Validators.Count == 0)
            {
                return;
            }

            if (validationMessages == null || !validationMessages.TryGetValue(this.VariableId, out Dictionary <string, string> messages))
            {
                throw new InvalidOperationException(Resources.validationMessagesRequiredFormat.FormatString(this.VariableId));
            }

            this.Errors = ValidationManager.DoValidation(CurrentValue, this.VariableId, this.ValidationSetting, messages);
        }