예제 #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;
        }
예제 #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();
 }
예제 #3
0
 public void Dispose()
 {
     while (writerStack.Count > 0)
         PopWriter();
     writer.Dispose();
     writer = null;
 }
예제 #4
0
 private void PushWriter()
 {
     writerStack.Push(writer);
     writer = new HtmlTextWriter(new StringWriter());
 }
예제 #5
0
 public HtmlPrinter(TextWriter w)
 {
     this.writer = new HtmlTextWriter(w);
 }