Esempio n. 1
0
        public ApplicationBlockSettings Build()
        {
            blockSettings = new ApplicationBlockSettings();

            BuildProviders();

            return(blockSettings);
        }
        /// <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 security settings configuration section.</returns>
        protected override ConfigurationSectionInfo GetConfigurationSectionInfo(IServiceProvider serviceProvider)
        {
            ConfigurationNode            rootNode = ServiceHelper.GetCurrentRootNode(serviceProvider);
            ApplicationBlockSettingsNode node     = null;

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

            if (node != null)
            {
                ApplicationBlockSettingsBuilder builder = new ApplicationBlockSettingsBuilder(serviceProvider, node);
                blockSettings = builder.Build();
            }
            return(new ConfigurationSectionInfo(node, blockSettings, ApplicationBlockSettings.SectionName));
        }
Esempio n. 3
0
 public ApplicationBlockSettingsNodeBuilder(IServiceProvider serviceProvider, ApplicationBlockSettings blockSettings)
     : base(serviceProvider)
 {
     this.blockSettings = blockSettings;
 }
Esempio n. 4
0
        /// <summary>
        /// Looks up a specified <see cref="SampleProvider"/>'s configuration from the given <paramref name="configurationSource"/>.
        /// </summary>
        /// <param name="name">The name of the <see cref="SampleProvider"/> for which the configuration should be looked up.</param>
        /// <param name="configurationSource">The configuration source which should be used.</param>
        /// <returns>The configuration for the specified <see cref="SampleProvider"/>.</returns>
        protected override SampleProviderData GetConfiguration(string name, IConfigurationSource configurationSource)
        {
            ApplicationBlockSettings settings = ApplicationBlockSettings.GetApplicationBlockSettings(configurationSource);

            return(settings.SampleProviderProviders.Get(name));
        }