public static object GetSection(string sectionName, string path)
 {
     if (!HttpConfigurationSystem.UseHttpConfigurationSystem)
     {
         throw new InvalidOperationException(System.Web.SR.GetString("Config_GetSectionWithPathArgInvalid"));
     }
     return(HttpConfigurationSystem.GetSection(sectionName, path));
 }
 public static object GetSection(string sectionName)
 {
     if (HttpConfigurationSystem.UseHttpConfigurationSystem)
     {
         return(HttpConfigurationSystem.GetSection(sectionName));
     }
     return(ConfigurationManager.GetSection(sectionName));
 }
Example #3
0
 public static object GetSection(string sectionName, string path)
 {
     if (HttpConfigurationSystem.UseHttpConfigurationSystem)
     {
         return(HttpConfigurationSystem.GetSection(sectionName, path));
     }
     else
     {
         throw new InvalidOperationException(SR.GetString(SR.Config_GetSectionWithPathArgInvalid));
     }
 }
 //
 // Return the config object for the current context.
 // If the HttpContext is not available, get the config object
 // for the web application path.
 //
 object IInternalConfigSystem.GetSection(string configKey)
 {
     return(HttpConfigurationSystem.GetSection(configKey));
 }