/// <summary>
		/// Gets the a <see cref="ConfigurationSectionInfo"/> for the logging 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 logging settings configuration section.</returns>
        protected override ConfigurationSectionInfo GetConfigurationSectionInfo(IServiceProvider serviceProvider)
        {
            ConfigurationNode rootNode = ServiceHelper.GetCurrentRootNode(serviceProvider);
            LoggingSettingsNode node = null;
            if (rootNode != null) node = (LoggingSettingsNode)rootNode.Hierarchy.FindNodeByType(rootNode, typeof(LoggingSettingsNode));
            LoggingSettings logggingSection = null;
            if (node != null)
            {
				LoggingSettingsBuilder builder = new LoggingSettingsBuilder(serviceProvider, node);
                logggingSection = builder.Build();
            }
            return new ConfigurationSectionInfo(node, logggingSection, LoggingSettings.SectionName);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the a <see cref="ConfigurationSectionInfo"/> for the logging 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 logging settings configuration section.</returns>
        protected override ConfigurationSectionInfo GetConfigurationSectionInfo(IServiceProvider serviceProvider)
        {
            ConfigurationNode   rootNode = ServiceHelper.GetCurrentRootNode(serviceProvider);
            LoggingSettingsNode node     = null;

            if (rootNode != null)
            {
                node = (LoggingSettingsNode)rootNode.Hierarchy.FindNodeByType(rootNode, typeof(LoggingSettingsNode));
            }
            LoggingSettings logggingSection = null;

            if (node != null)
            {
                LoggingSettingsBuilder builder = new LoggingSettingsBuilder(serviceProvider, node);
                logggingSection = builder.Build();
            }
            return(new ConfigurationSectionInfo(node, logggingSection, LoggingSettings.SectionName));
        }