object GetConfigInternal(string sectionName, HttpContext context, bool useLoc) { object handler = GetHandler(sectionName); IConfigurationSectionHandler iconf = handler as IConfigurationSectionHandler; if (iconf == null) { return(handler); } object parentConfig = null; if (parent != null) { if (useLoc) { parentConfig = parent.GetConfig(sectionName, context); } else { parentConfig = parent.GetConfigOptLocation(sectionName, context, false); } } XmlDocument doc = GetDocumentForSection(sectionName); if (doc == null || doc.DocumentElement == null) { return(parentConfig); } return(iconf.Create(parentConfig, fileName, doc.DocumentElement)); }
public object GetConfig(string sectionName, HttpContext context) { if (context == null) { return(null); } ConfigurationData config = GetConfigFromFileName(context.Request.CurrentExecutionFilePath, context); if (config == null) { return(null); } return(config.GetConfig(sectionName, context)); }