コード例 #1
0
        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());
        }
コード例 #2
0
 void ITextChunk.WriteTo(TextWriter writer)
 {
     if (_chunk.Length == 0)
     {
         return;
     }
     writer.Write(_text.WrapStart);
     _chunk.WriteTo(writer);
     writer.Write(_text.WrapEnd);
 }