/// <summary>
        /// Gets the a <see cref="ConfigurationSectionInfo"/> for the security settings configuration section.
        /// </summary>
        /// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
        /// <returns>A <see cref="ConfigurationSectionInfo"/> for the validation settings configuration section.</returns>
        protected override Microsoft.Practices.EnterpriseLibrary.Configuration.Design.ConfigurationSectionInfo GetConfigurationSectionInfo(IServiceProvider serviceProvider)
        {
            ConfigurationNode rootNode = ServiceHelper.GetCurrentRootNode(serviceProvider);
            ValidationSettingsNode node = null;
            if (null != rootNode) node = rootNode.Hierarchy.FindNodeByType(rootNode, typeof(ValidationSettingsNode)) as ValidationSettingsNode;
            ValidationSettings blockSettings = null;
            if (node != null)
            {
                ValidationSettingsBuilder builder = new ValidationSettingsBuilder(serviceProvider, node);
                blockSettings = builder.Build();
            }

            string protectionProviderName = GetProtectionProviderName(node);
            return new ConfigurationSectionInfo(node, blockSettings, ValidationSettings.SectionName, protectionProviderName);
        }
예제 #2
0
        /// <summary>
        /// Gets the a <see cref="ConfigurationSectionInfo"/> for the security settings configuration section.
        /// </summary>
        /// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
        /// <returns>A <see cref="ConfigurationSectionInfo"/> for the validation settings configuration section.</returns>
        protected override Microsoft.Practices.EnterpriseLibrary.Configuration.Design.ConfigurationSectionInfo GetConfigurationSectionInfo(IServiceProvider serviceProvider)
        {
            ConfigurationNode      rootNode = ServiceHelper.GetCurrentRootNode(serviceProvider);
            ValidationSettingsNode node     = null;

            if (null != rootNode)
            {
                node = rootNode.Hierarchy.FindNodeByType(rootNode, typeof(ValidationSettingsNode)) as ValidationSettingsNode;
            }
            ValidationSettings blockSettings = null;

            if (node != null)
            {
                ValidationSettingsBuilder builder = new ValidationSettingsBuilder(serviceProvider, node);
                blockSettings = builder.Build();
            }

            string protectionProviderName = GetProtectionProviderName(node);

            return(new ConfigurationSectionInfo(node, blockSettings, ValidationSettings.SectionName, protectionProviderName));
        }