/// <summary>
		/// Gets a <see cref="ConfigurationSectionInfo"/> object containing the Caching Block's configuration information.
		/// </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"/> object containing the Caching Block's configuration information.</returns>
		protected override ConfigurationSectionInfo GetConfigurationSectionInfo(IServiceProvider serviceProvider)
		{
			ConfigurationNode rootNode = ServiceHelper.GetCurrentRootNode(serviceProvider);
			CacheManagerSettingsNode node = null;
			if (rootNode != null) node = (CacheManagerSettingsNode)rootNode.Hierarchy.FindNodeByType(rootNode, typeof(CacheManagerSettingsNode));
			CacheManagerSettings cacheSection = null;
			if (node == null)
			{
                cacheSection = null;
			}
			else
			{
				CacheManagerSettingsBuilder builder = new CacheManagerSettingsBuilder(serviceProvider, node);
				cacheSection = builder.Build();
			}
			return new ConfigurationSectionInfo(node, cacheSection, CacheManagerSettings.SectionName);
		}
Пример #2
0
        /// <summary>
        /// Gets a <see cref="ConfigurationSectionInfo"/> object containing the Caching Block's configuration information.
        /// </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"/> object containing the Caching Block's configuration information.</returns>
        protected override ConfigurationSectionInfo GetConfigurationSectionInfo(IServiceProvider serviceProvider)
        {
            ConfigurationNode        rootNode = ServiceHelper.GetCurrentRootNode(serviceProvider);
            CacheManagerSettingsNode node     = null;

            if (rootNode != null)
            {
                node = (CacheManagerSettingsNode)rootNode.Hierarchy.FindNodeByType(rootNode, typeof(CacheManagerSettingsNode));
            }
            CacheManagerSettings cacheSection = null;

            if (node == null)
            {
                cacheSection = null;
            }
            else
            {
                CacheManagerSettingsBuilder builder = new CacheManagerSettingsBuilder(serviceProvider, node);
                cacheSection = builder.Build();
            }
            return(new ConfigurationSectionInfo(node, cacheSection, CacheManagerSettings.SectionName));
        }