Exemplo n.º 1
0
        private string PopWriter()
        {
            var htmlWriter = writer;
            var sw = (StringWriter)writer._inner;
            writer = writerStack.Pop();

            htmlWriter.Flush();
            sw.Flush();

            string result = sw.ToString();

            htmlWriter.Dispose();
            sw.Dispose();
            return result;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Adds a newline if the writer does not currently end with a newline.
 /// </summary>
 /// <remarks>Orig: cr</remarks>
 private static void EnsureNewlineEnding(HtmlTextWriter writer)
 {
     if (!writer.EndsWithNewline)
         writer.WriteLine();
 }
Exemplo n.º 3
0
 public void Dispose()
 {
     while (writerStack.Count > 0)
         PopWriter();
     writer.Dispose();
     writer = null;
 }
Exemplo n.º 4
0
 private void PushWriter()
 {
     writerStack.Push(writer);
     writer = new HtmlTextWriter(new StringWriter());
 }
Exemplo n.º 5
0
 public HtmlPrinter(TextWriter w)
 {
     this.writer = new HtmlTextWriter(w);
 }