/// <summary> /// Retrieve an app setting float 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 float.</exception> public float GetFloat(string key) { var value = GetString(key); return(ConfigValueConverter.GetFloat(key, value)); }
/// <summary> /// Retrieves a float 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 float.</exception> public float GetFloat(string key, string sectionName) { var value = GetString(key, sectionName); return(ConfigValueConverter.GetFloat(key, value)); }