/// <summary>
    /// Adds a Text object.
    /// </summary>
    /// <param name="text">Content of the new Text object.</param>
    /// <returns>Returns a new Text object.</returns>
    public Text AddText(string text)
    {
      if (text == null)
        throw new ArgumentNullException("text");
#if true
      Text txt = null;
      string[] lines = text.Split('\n');
      int lineCount = lines.Length;
      for (int line = 0; line < lineCount; line++)
      {
        string[] tabParts = lines[line].Split('\t');
        int count = tabParts.Length;
        for (int idx = 0; idx < count; idx++)
        {
          if (tabParts[idx].Length != 0)
          {
            txt = new Text(tabParts[idx]);
            this.Add(txt);
          }
          if (idx < count - 1)
            this.AddTab();
        }
        if (line < lineCount - 1)
          this.AddLineBreak();
      }
      return txt;
#else
      Text txt = new Text();
      txt.Content = text;
      this.Add(txt);
      return txt;
#endif
    }
Пример #2
0
 /// <summary>
 /// Processes a text element during formatting.
 /// </summary>
 /// <param name="text">The text element to measure.</param>
 FormatResult FormatText(Text text)
 {
   return FormatWord(text.Content);
 }
Пример #3
0
 void RenderText(Text text)
 {
   RenderWord(text.Content);
 }
Пример #4
0
 /// <summary>
 /// Adds a new Text
 /// </summary>
 public void Add(Text text)
 {
   this.Elements.Add(text);
 }
Пример #5
0
 internal TextRenderer(DocumentObject domObj, RtfDocumentRenderer docRenderer)
     : base(domObj, docRenderer)
 {
     this.text = domObj as Text;
 }
Пример #6
0
 /// <summary>
 /// Adds a new Text
 /// </summary>
 public void Add(Text text)
 {
     Elements.Add(text);
 }