public static string ToText(this ITextChunk chunk) { var sb = new System.Text.StringBuilder(chunk.Length); var writer = new System.IO.StringWriter(sb); chunk.WriteTo(writer); return(sb.ToString()); }
void ITextChunk.WriteTo(TextWriter writer) { if (_chunk.Length == 0) { return; } writer.Write(_text.WrapStart); _chunk.WriteTo(writer); writer.Write(_text.WrapEnd); }