示例#1
0
 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;
 }
示例#2
0
 bool TryGetBool(IniSection section, string key, bool def)
 {
     var str = section.GetValue(key);
     if(str == null)
         return def;
     return str.ToLower() == "yes";
 }