/// <summary>
        /// Retrieve an app setting char value from config.
        /// </summary>
        /// <param name="key">Key to use when retrieving the value.</param>
        /// <returns>App setting value.</returns>
        /// <exception cref="T:ByteDev.Configuration.AppSettings.AppSettingsKeyNotExistException">Config does not contain AppSetting with <paramref name="key" />.</exception>
        /// <exception cref="T:ByteDev.Configuration.UnexpectedConfigValueTypeException">Config value is not of type char.</exception>
        public char GetChar(string key)
        {
            var value = GetString(key);

            return(ConfigValueConverter.GetChar(key, value));
        }
Пример #2
0
        /// <summary>
        /// Retrieves a char value.
        /// </summary>
        /// <param name="key">Key to retrieve the value.</param>
        /// <param name="sectionName">Section name to retrieve the value from.</param>
        /// <returns>Config value for the <paramref name="key" />.</returns>
        /// <exception cref="T:ByteDev.Configuration.ConfigSection.ConfigSettingsProviderException">Config section does not exist.</exception>
        /// <exception cref="T:ByteDev.Configuration.ConfigSection.ConfigSettingsProviderException">Key does not exist in the section.</exception>
        /// <exception cref="T:ByteDev.Configuration.UnexpectedConfigValueTypeException">Config value is not of type char.</exception>
        public char GetChar(string key, string sectionName)
        {
            var value = GetString(key, sectionName);

            return(ConfigValueConverter.GetChar(key, value));
        }