示例#1
0
 public static void EncodeValue(object value, JsonBuilder builder)
 {
     if (JsonBuilder.IsSupported(value))
     {
         builder.AppendValue(value);
     }
     else
     {
         Encoder encoder = GetEncoder(value.GetType());
         if (encoder != null)
         {
             encoder(value, builder);
         }
         else
         {
             Console.WriteLine("encoder for " + value.GetType() + " not found");
         }
     }
 }
示例#2
0
 public static void EncodeNameValue(string name, object value, JsonBuilder builder)
 {
     builder.AppendName(UnwrapName(name));
     EncodeValue(value, builder);
 }