Ejemplo n.º 1
0
        /// <summary>
        /// Returns the runtime configuration data that is represented by this node.
        /// </summary>
        /// <returns>An instance of <see cref="AndCompositeValidatorData"/> that can be persisted to a configuration file.</returns>
        public override ValidatorData CreateValidatorData()
        {
            AndCompositeValidatorData validatorData = new AndCompositeValidatorData(Name);

            foreach (ConfigurationNode childNode in Nodes)
            {
                ValidatorNodeBase validatorNode = childNode as ValidatorNodeBase;
                if (validatorNode != null)
                {
                    validatorData.Validators.Add(validatorNode.CreateValidatorData());
                }
            }
            return(validatorData);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns the runtime configuration data that is represented by this node.
        /// </summary>
        /// <returns>An instance of <see cref="OrCompositeValidatorData"/> that can be persisted to a configuration file.</returns>
        public override ValidatorData CreateValidatorData()
        {
            OrCompositeValidatorData validatorData = new OrCompositeValidatorData(Name);

            validatorData.MessageTemplate                 = messageTemplate;
            validatorData.MessageTemplateResourceName     = messageTemplateResourceName;
            validatorData.MessageTemplateResourceTypeName = messageTemplateResourceTypeName;
            validatorData.Tag = tag;

            foreach (ConfigurationNode childNode in Nodes)
            {
                ValidatorNodeBase validatorNode = childNode as ValidatorNodeBase;
                if (validatorNode != null)
                {
                    validatorData.Validators.Add(validatorNode.CreateValidatorData());
                }
            }
            return(validatorData);
        }