Newtonsoft.Json.JsonWriter.Close C# (CSharp) Method

Close() public method

Closes this stream and the underlying stream.
public Close ( ) : void
return void
        public virtual void Close()
        {
            AutoCompleteAll();
        }

Usage Example

Beispiel #1
0
 public static string FromHashtableQueue(Queue<Hashtable> queue)
 {
     StringWriter textWriter = new StringWriter();
     JsonWriter jsonWriter = new JsonWriter(textWriter);
     jsonWriter.WriteStartArray();
     JsonSerializer serializer = new JsonSerializer();
     UUIDConverter UUID = new UUIDConverter();
     serializer.Converters.Add(UUID);
     while (queue.Count > 0)
     {
         try
         {
             Hashtable hashtable = queue.Dequeue();
             serializer.Serialize(jsonWriter, hashtable);
         }
         catch(Exception e)
         {
             AjaxLife.Debug("MakeJson.FromHashTable", e.Message);
         }
     }
     jsonWriter.WriteEndArray();
     jsonWriter.Flush();
     string text = textWriter.ToString();
     jsonWriter.Close();
     textWriter.Dispose();
     return text;
 }
All Usage Examples Of Newtonsoft.Json.JsonWriter::Close