public ConfigurationSection Get(string name)
        {
            VerifyIsAttachedToConfigRecord();

            // validate name
            if (string.IsNullOrEmpty(name))
            {
                throw ExceptionUtil.ParameterNullOrEmpty(nameof(name));
            }

            // prevent GetConfig from returning config not in this collection
            if (name.IndexOf('/') >= 0)
            {
                return(null);
            }

            // get the section from the config record
            string configKey = BaseConfigurationRecord.CombineConfigKey(_configSectionGroup.SectionGroupName, name);

            return((ConfigurationSection)_configRecord.GetSection(configKey));
        }
Beispiel #2
0
        // public methods
        public ConfigurationSection GetSection(string sectionName)
        {
            ConfigurationSection section = (ConfigurationSection)_configRecord.GetSection(sectionName);

            return(section);
        }