private static void WriteDictionaryAsObject(WriterState writer, IDictionary <string, object> dictionary)
        {
            writer.Write((byte)SerializedType.Object);

            foreach (var(key, value) in dictionary.Keys.Zip(dictionary.Values))
            {
                writer.Write((byte)EnumerableType.HasItem);
                writer.WriteString(key);
                WriteValue(writer, value);
            }

            writer.Write((byte)EnumerableType.End);
        }
Esempio n. 2
0
 private static void WriteMemberName(WriterState writer, string memberName)
 {
     writer.Write((byte)EnumerableType.HasItem);
     writer.WriteString(memberName);
 }