예제 #1
0
        public virtual void Format(JsonWriter writer)
        {
            writer.WriteStartObject();
            
            foreach (string name in _nameIndexList)
            {
                writer.WriteMember(name);    
                writer.WriteValue(InnerHashtable[name]);
            }

            writer.WriteEndObject();
        }
예제 #2
0
     protected virtual void FormatDictionary(IDictionary dictionary, JsonWriter writer)
     {
         writer.WriteStartObject();
 
         foreach (DictionaryEntry entry in dictionary)
         {
             writer.WriteMember(entry.Key.ToString());
             writer.WriteValue(entry.Value);
         }
 
         writer.WriteEndObject();
     }
예제 #3
0
        public void Export(JsonWriter writer)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");

            writer.WriteStartObject();
            
            foreach (string name in NameIndexList)
            {
                writer.WriteMember(name);    
                writer.WriteValue(InnerHashtable[name]);
            }

            writer.WriteEndObject();
        }
예제 #4
0
        public virtual void WriteArray(IEnumerable values, JsonWriter valueWriter)
        {
            if (values == null)
            {
                WriteNull();
            }
            else
            {
                WriteStartArray();

                foreach (object value in values)
                    valueWriter.WriteValue(value);

                WriteEndArray();
            }
        }