コード例 #1
0
 private Task SerializePublicId(PublicId arg, Stream dest, CustomJsonSerializer serializer)
 {
     serializer.SerializeString(arg.ToString(), dest);
     return(Task.CompletedTask);
 }
コード例 #2
0
 private Task SerializeChar(char arg, Stream dest, CustomJsonSerializer serializer)
 {
     SerializeString(arg.ToString(), dest);
     return(Task.CompletedTask);
 }
コード例 #3
0
 private Task SerializeBool(bool arg, Stream dest, CustomJsonSerializer serializer)
 {
     dest.Write(System.Text.Encoding.UTF8.GetBytes(arg ? "true" : "false"));
     return(Task.CompletedTask);
 }
コード例 #4
0
 private Task SerializeDouble(double arg, Stream dest, CustomJsonSerializer serializer)
 {
     dest.Write(System.Text.Encoding.UTF8.GetBytes(arg.ToString()));
     return(Task.CompletedTask);
 }
コード例 #5
0
 private async Task SerializeCollection(CollectionObject collection, Stream dest, CustomJsonSerializer serializer)
 {
     if (collection.IsBaseObjectDefined)
     {
         await SerializeObject(collection, dest);
     }
     else if (collection.items != null)
     {
         await SerializeArray(collection.items, dest);
     }
     else
     {
         await SerializeNull(dest);
     }
 }