public OptionConfigurationSection GetSection(string path)
        {
            if (string.IsNullOrWhiteSpace(path))
            {
                throw new ArgumentNullException(nameof(path));
            }

            path = path.Trim().Trim('/');

            if (!_sections.Contains(path))
            {
                throw new OptionConfigurationException($"No found specified by '{path}' path of option section in the '{this.FilePath}' configuration file.");
            }

            return(_sections[path]);
        }
Beispiel #2
0
        public OptionConfigurationSection GetSection(string path)
        {
            if (string.IsNullOrWhiteSpace(path))
            {
                throw new ArgumentNullException("path");
            }

            path = path.Trim().Trim('/');

            if (!_sections.Contains(path))
            {
                throw new OptionConfigurationException(string.Format("No found specified by '{0}' path of option section in the '{1}' configuration file.", path, _filePath));
            }

            return(_sections[path]);
        }