Beispiel #1
0
 /// <summary>
 /// Returns an integer value from the INI section.
 /// </summary>
 /// <param name="key">The name of the INI key.</param>
 /// <param name="defaultValue">The value to return if the section or key wasn't found,
 /// or converting the key's value to an integer failed.</param>
 /// <returns>The given key's value if the section and key was found and
 /// the value is a valid integer. Otherwise the given defaultValue.</returns>
 public int GetIntValue(string key, int defaultValue)
 {
     return Conversions.IntFromString(GetStringValue(key, string.Empty), defaultValue);
 }
Beispiel #2
0
 /// <summary>
 /// Returns an integer value from the INI file.
 /// </summary>
 /// <param name="section">The name of the key's section.</param>
 /// <param name="key">The name of the INI key.</param>
 /// <param name="defaultValue">The value to return if the section or key wasn't found,
 /// or converting the key's value to an integer failed.</param>
 /// <returns>The given key's value if the section and key was found and
 /// the value is a valid integer. Otherwise the given defaultValue.</returns>
 public int GetIntValue(string section, string key, int defaultValue)
 {
     return Conversions.IntFromString(GetStringValue(section, key, null), defaultValue);
 }