/// <summary> /// Gets the a <see cref="ConfigurationSectionInfo"/> for the oracle connection 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 oracle connection configuration section.</returns> protected override ConfigurationSectionInfo GetConfigurationSectionInfo(IServiceProvider serviceProvider) { ConfigurationNode rootNode = ServiceHelper.GetCurrentRootNode(serviceProvider); DatabaseSectionNode databaseSectionNode = null; if (rootNode != null) { databaseSectionNode = rootNode.Hierarchy.FindNodeByType(rootNode, typeof(DatabaseSectionNode)) as DatabaseSectionNode; } OracleConnectionSettings oracleConnectionSection = null; IList <ConfigurationNode> connections = rootNode.Hierarchy.FindNodesByType(typeof(OracleConnectionElementNode)); if (connections.Count == 0) { oracleConnectionSection = null; } else { OracleConnectionSettingsBuilder builder = new OracleConnectionSettingsBuilder(serviceProvider); oracleConnectionSection = builder.Build(); } string protectionProviderName = GetProtectionProviderName(databaseSectionNode); return(new ConfigurationSectionInfo(rootNode, oracleConnectionSection, OracleConnectionSettings.SectionName, protectionProviderName)); }
/// <summary> /// Gets the a <see cref="ConfigurationSectionInfo"/> for the oracle connection 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 oracle connection configuration section.</returns> protected override ConfigurationSectionInfo GetConfigurationSectionInfo(IServiceProvider serviceProvider) { ConfigurationNode rootNode = ServiceHelper.GetCurrentRootNode(serviceProvider); OracleConnectionSettings oracleConnectionSection = null; IList<ConfigurationNode> connections = rootNode.Hierarchy.FindNodesByType(typeof(OracleConnectionElementNode)); if (connections.Count == 0) { oracleConnectionSection = null; } else { OracleConnectionSettingsBuilder builder = new OracleConnectionSettingsBuilder(serviceProvider); oracleConnectionSection = builder.Build(); } return new ConfigurationSectionInfo(rootNode, oracleConnectionSection, OracleConnectionSettings.SectionName); }
/// <summary> /// Gets the a <see cref="ConfigurationSectionInfo"/> for the oracle connection 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 oracle connection configuration section.</returns> protected override ConfigurationSectionInfo GetConfigurationSectionInfo(IServiceProvider serviceProvider) { ConfigurationNode rootNode = ServiceHelper.GetCurrentRootNode(serviceProvider); OracleConnectionSettings oracleConnectionSection = null; IList <ConfigurationNode> connections = rootNode.Hierarchy.FindNodesByType(typeof(OracleConnectionElementNode)); if (connections.Count == 0) { oracleConnectionSection = null; } else { OracleConnectionSettingsBuilder builder = new OracleConnectionSettingsBuilder(serviceProvider); oracleConnectionSection = builder.Build(); } return(new ConfigurationSectionInfo(rootNode, oracleConnectionSection, OracleConnectionSettings.SectionName)); }