/// <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);
     CryptographySettingsNode node = null;
     if (rootNode != null) node = (CryptographySettingsNode)rootNode.Hierarchy.FindNodeByType(rootNode, typeof(CryptographySettingsNode));
     CryptographySettings cryptoSection = null;
     if (node == null)
     {
         cryptoSection = null;
     }
     else
     {
         CryptographyManagerSettingsBuilder builder = new CryptographyManagerSettingsBuilder(serviceProvider, node);
         cryptoSection = builder.Build();
     }
     return new ConfigurationSectionInfo(node, cryptoSection, CryptographyConfigurationView.SectionName);
 }
Beispiel #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);
            CryptographySettingsNode node     = null;

            if (rootNode != null)
            {
                node = (CryptographySettingsNode)rootNode.Hierarchy.FindNodeByType(rootNode, typeof(CryptographySettingsNode));
            }
            CryptographySettings cryptoSection = null;

            if (node == null)
            {
                cryptoSection = null;
            }
            else
            {
                CryptographyManagerSettingsBuilder builder = new CryptographyManagerSettingsBuilder(serviceProvider, node);
                cryptoSection = builder.Build();
            }
            return(new ConfigurationSectionInfo(node, cryptoSection, CryptographyConfigurationView.SectionName));
        }