Пример #1
0
 public static string WriteBasicDataType(object value, Type type)
 {
     if (type == typeof(string))
     {
         return(JsonWriter.StringType(value));
     }
     else if (type == typeof(int))
     {
         return(JsonWriter.IntType(value));
     }
     else if (type == typeof(float))
     {
         return(JsonWriter.FloatType(value));
     }
     else if (type == typeof(bool))
     {
         return(JsonWriter.BoolType(value));
     }
     else
     {
         throw new Exception("Provided type is not a basic one");
     }
 }