This is primarily used to replace the StringBuffer class, as a way for the Formatter to store the start tag for an XML element. This enables the start tag of the current element to be removed without disrupting any of the other nodes within the document. Once the contents of the output buffer have been filled its contents can be emitted to the writer object.
Ejemplo n.º 1
0
 /// <summary>
 /// Constructor for the <c>Formatter</c> object. This creates
 /// an object that can be used to write XML in an indented format
 /// to the specified writer. The XML written will be well formed.
 /// </summary>
 /// <param name="result">
 /// this is where the XML should be written to
 /// </param>
 /// <param name="format">
 /// this is the format object to use
 /// </param>
 public Formatter(TextWriter result, Format format)
 {
     this.indenter = new Indenter(format);
     this.buffer   = new OutputBuffer();
     this.prolog   = format.Prolog;
     this.result   = result;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor for the <c>Formatter</c> object. This creates
 /// an object that can be used to write XML in an indented format
 /// to the specified writer. The XML written will be well formed.
 /// </summary>
 /// <param name="result">
 /// this is where the XML should be written to
 /// </param>
 /// <param name="format">
 /// this is the format object to use
 /// </param>
 public Formatter(TextWriter result, Format format){
    this.indenter = new Indenter(format);
    this.buffer = new OutputBuffer();
    this.prolog = format.Prolog;
    this.result = result;
 }