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