int TryGetInt(IniSection section, string key, int def) { var str = section.GetValue(key); if(str == null) return def; int ret; if(!int.TryParse(str, out ret)) return def; return ret; }
bool TryGetBool(IniSection section, string key, bool def) { var str = section.GetValue(key); if(str == null) return def; return str.ToLower() == "yes"; }