Esempio n. 1
0
 public object TryGet(Type type, string key)
 {
     if (type == typeof(int))
     {
         return(Ints.ValueOrDefault(key));
     }
     if (type == typeof(string))
     {
         return(Strings.ValueOrDefault(key));
     }
     if (type == typeof(float))
     {
         return(Floats.ValueOrDefault(key));
     }
     if (type == typeof(bool))
     {
         return(Bools.ValueOrDefault(key));
     }
     return(type.GetDefaultValue());
 }