/// <summary> /// Gets the current applications <OlapConfigSection> section. /// </summary> /// <param name="ConfigLevel"> /// The <ConfigurationUserLevel> that the config file /// is retrieved from. /// </param> /// <returns> /// The configuration file's <OlapConfigSection> section. /// </returns> public static OlapConfigSectionSettings GetSection(ConfigurationUserLevel ConfigLevel) { /* * This class is setup using a factory pattern that forces you to * name the section <OlapConfigSection> in the config file. * If you would prefer to be able to specify the name of the section, * then remove this method and mark the constructor public. */ System.Configuration.Configuration Config = ConfigurationManager.OpenExeConfiguration (ConfigLevel); OlapConfigSectionSettings oOlapConfigSectionSettings; oOlapConfigSectionSettings = (OlapConfigSectionSettings)Config.GetSection("OlapConfigSectionSettings"); if (oOlapConfigSectionSettings == null) { oOlapConfigSectionSettings = new OlapConfigSectionSettings(); Config.Sections.Add("OlapConfigSectionSettings", oOlapConfigSectionSettings); } oOlapConfigSectionSettings._Config = Config; return oOlapConfigSectionSettings; }
/// <summary> /// Gets the current applications <OlapConfigSection> section. /// </summary> /// <param name="ConfigLevel"> /// The <ConfigurationUserLevel> that the config file /// is retrieved from. /// </param> /// <returns> /// The configuration file's <OlapConfigSection> section. /// </returns> public static OlapConfigSectionSettings GetSection(ConfigurationUserLevel ConfigLevel) { /* * This class is setup using a factory pattern that forces you to * name the section <OlapConfigSection> in the config file. * If you would prefer to be able to specify the name of the section, * then remove this method and mark the constructor public. */ System.Configuration.Configuration Config = ConfigurationManager.OpenExeConfiguration (ConfigLevel); OlapConfigSectionSettings oOlapConfigSectionSettings; oOlapConfigSectionSettings = (OlapConfigSectionSettings)Config.GetSection("OlapConfigSectionSettings"); if (oOlapConfigSectionSettings == null) { oOlapConfigSectionSettings = new OlapConfigSectionSettings(); Config.Sections.Add("OlapConfigSectionSettings", oOlapConfigSectionSettings); } oOlapConfigSectionSettings._Config = Config; return(oOlapConfigSectionSettings); }