static void PrettyColorPrint(string path, TextWriter output, JsonPalette palette) { Debug.Assert(output != null); using (var input = path.Equals("-") ? Console.In : new StreamReader(path)) using (var reader = new JsonTextReader(input)) using (var writer = new JsonTextWriter(output)) { writer.PrettyPrint = true; var colorWriter = new JsonColorWriter(writer, palette); colorWriter.WriteFromReader(reader); output.WriteLine(); } }
private static void PrettyColorPrint(string path, TextWriter output, JsonPalette palette) { Debug.Assert(output != null); using (TextReader input = path.Equals("-") ? Console.In : new StreamReader(path)) using (JsonTextReader reader = new JsonTextReader(input)) using (JsonTextWriter writer = new JsonTextWriter(output)) { writer.PrettyPrint = true; JsonColorWriter colorWriter = new JsonColorWriter(writer, palette); colorWriter.WriteFromReader(reader); output.WriteLine(); } }