コード例 #1
0
 /// <summary>
 /// append child element
 /// </summary>
 /// <param name="element">child element</param>
 /// <returns>index of element</returns>
 public int AppendChild(RTFDomElement element)
 {
     CheckLocked();
     element.myParent      = this;
     element.OwnerDocument = this.myOwnerDocument;
     return(myElements.Add(element));
 }
コード例 #2
0
 /// <summary>
 /// 判断对象是否有实际内容
 /// </summary>
 /// <param name="rootElement">根元素对象</param>
 /// <returns>是否有实际内容</returns>
 public static bool HasContentElement(RTFDomElement rootElement)
 {
     if (rootElement.Elements.Count == 0)
     {
         return(false);
     }
     if (rootElement.Elements.Count == 1)
     {
         if (rootElement.Elements[0] is RTFDomParagraph)
         {
             RTFDomParagraph p = (RTFDomParagraph)rootElement.Elements[0];
             if (p.Elements.Count == 0)
             {
                 return(false);
             }
         }
     }
     return(true);
 }
コード例 #3
0
 /// <summary>
 /// Get the index of special element that starts with 0.
 /// </summary>
 /// <param name="element">element</param>
 /// <returns>index , if not find element , then return -1</returns>
 public int IndexOf(RTFDomElement element)
 {
     return(this.List.IndexOf(element));
 }
コード例 #4
0
 /// <summary>
 /// insert element
 /// </summary>
 /// <param name="index">special index</param>
 /// <param name="element">element</param>
 public void Insert(int index, RTFDomElement element)
 {
     this.List.Insert(index, element);
 }
コード例 #5
0
 /// <summary>
 /// add element
 /// </summary>
 /// <param name="element">element</param>
 /// <returns>index</returns>
 public int Add(RTFDomElement element)
 {
     return(this.List.Add(element));
 }
コード例 #6
0
 /// <summary>
 /// delete element
 /// </summary>
 /// <param name="node">element</param>
 public void Remove(RTFDomElement node)
 {
     this.List.Remove(node);
 }