The Labs \ Source Viewer \ SSCLI \ System.Net.Configuration \ NetSectionGroup

  1. //------------------------------------------------------------------------------
  2. // <copyright file="NetSectionGroup.cs" company="Microsoft Corporation">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. namespace System.Net.Configuration
  16. {
  17.     using System.Configuration;
  18.    
  19.     /// <summary>
  20.     /// Summary description for NetSectionGroup.
  21.     /// </summary>
  22.     public sealed class NetSectionGroup : ConfigurationSectionGroup
  23.     {
  24.         public NetSectionGroup()
  25.         {
  26.         }
  27.        
  28.         // public properties
  29.         [ConfigurationProperty(ConfigurationStrings.AuthenticationModulesSectionName)]
  30.         public AuthenticationModulesSection AuthenticationModules {
  31.             get { return (AuthenticationModulesSection)Sections[ConfigurationStrings.AuthenticationModulesSectionName]; }
  32.         }
  33.        
  34.         [ConfigurationProperty(ConfigurationStrings.ConnectionManagementSectionName)]
  35.         public ConnectionManagementSection ConnectionManagement {
  36.             get { return (ConnectionManagementSection)Sections[ConfigurationStrings.ConnectionManagementSectionName]; }
  37.         }
  38.        
  39.         [ConfigurationProperty(ConfigurationStrings.DefaultProxySectionName)]
  40.         public DefaultProxySection DefaultProxy {
  41.             get { return (DefaultProxySection)Sections[ConfigurationStrings.DefaultProxySectionName]; }
  42.         }
  43.        
  44.        
  45.         public static NetSectionGroup GetSectionGroup(Configuration config)
  46.         {
  47.             if (config == null)
  48.                 throw new ArgumentNullException("config");
  49.             return config.GetSectionGroup(ConfigurationStrings.SectionGroupName) as NetSectionGroup;
  50.         }
  51.        
  52.         [ConfigurationProperty(ConfigurationStrings.RequestCachingSectionName)]
  53.         public RequestCachingSection RequestCaching {
  54.             get { return (RequestCachingSection)Sections[ConfigurationStrings.RequestCachingSectionName]; }
  55.         }
  56.        
  57.         [ConfigurationProperty(ConfigurationStrings.SettingsSectionName)]
  58.         public SettingsSection Settings {
  59.             get { return (SettingsSection)Sections[ConfigurationStrings.SettingsSectionName]; }
  60.         }
  61.        
  62.         [ConfigurationProperty(ConfigurationStrings.WebRequestModulesSectionName)]
  63.         public WebRequestModulesSection WebRequestModules {
  64.             get { return (WebRequestModulesSection)Sections[ConfigurationStrings.WebRequestModulesSectionName]; }
  65.         }
  66.        
  67.     }
  68. }

Developer Fusion