Ejemplo n.º 1
0
 public static T TryGetValue <T>(this Nett.TomlTable table, string key, T @default)
 {
     if (table.TryGetValue(key, out var obj))
     {
         return(obj.Get <T>());
     }
     else
     {
         return(@default);
     }
 }
Ejemplo n.º 2
0
 public static bool TryGetValue <T>(this Nett.TomlTable table, string key, out T value)
 {
     if (table.TryGetValue(key, out var obj))
     {
         value = obj.Get <T>();
         return(true);
     }
     else
     {
         value = default(T);
         return(false);
     }
 }