private static void WriteJsonArray(RavenJArray array, CountingWriter sw, int width, int numberOfLines) { sw.WriteLine("["); sw.PushIndent(); var isFirstItem = true; foreach (var token in array.Values()) { if (sw.LinesWritten >= numberOfLines) { break; } if (isFirstItem) { isFirstItem = false; } else { sw.WriteLine(","); } WriteValue(token, sw, width, numberOfLines); } sw.WriteLine(""); sw.PopIndent(); sw.Write("]"); }
private static void WriteJsonObject(RavenJObject ravenJObject, CountingWriter sw, int width, int numberOfLines) { sw.WriteLine("{"); sw.PushIndent(); foreach (var item in ravenJObject) { if (sw.LinesWritten > numberOfLines) break; sw.Write(item.Key); sw.Write(": "); WriteValue(item.Value, sw, width, numberOfLines); sw.WriteLine(""); } sw.PopIndent(); sw.Write("}"); }
private static void WriteJsonArray(RavenJArray array, CountingWriter sw, int width, int numberOfLines) { sw.WriteLine("["); sw.PushIndent(); var isFirstItem = true; foreach (var token in array.Values()) { if (sw.LinesWritten >= numberOfLines) break; if (isFirstItem) isFirstItem = false; else sw.WriteLine(","); WriteValue(token, sw, width, numberOfLines); } sw.WriteLine(""); sw.PopIndent(); sw.Write("]"); }
private static void WriteJsonObject(RavenJObject ravenJObject, CountingWriter sw, int width, int numberOfLines) { sw.WriteLine("{"); sw.PushIndent(); foreach (var item in ravenJObject) { if (sw.LinesWritten > numberOfLines) { break; } sw.Write(item.Key); sw.Write(": "); WriteValue(item.Value, sw, width, numberOfLines); sw.WriteLine(""); } sw.PopIndent(); sw.Write("}"); }