/// <summary> /// Initializes a new instance of the <see cref="MultiFormatOutputWriter"/> class. /// </summary> /// <param name="format">Format</param> /// <param name="stringBuilder">The string builder</param> public MultiFormatOutputWriter(MultiFormatOutputWriterFormat format, StringBuilder stringBuilder) : base() { this.stringBuilder = stringBuilder; this.textWriter = new StringWriter(this.stringBuilder); this.jsonTextWriter = new JsonTextWriter(this.textWriter) { Formatting = Formatting.Indented }; this.xmlTextWriter = new Xml.XmlTextWriter(this.textWriter) { Formatting = Xml.Formatting.Indented }; }
// constructors /// <summary> /// Initializes a new instance of the <see cref="MultiFormatOutputWriter"/> class. /// </summary> /// <param name="format">Format</param> public MultiFormatOutputWriter(MultiFormatOutputWriterFormat format) : this(format, new StringBuilder()) { this.format = format; }