RTF dom element
this is the most base element type
Ejemplo n.º 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));
 }
Ejemplo n.º 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)
         {
             var p = (RTFDomParagraph)rootElement.Elements[0];
             if (p.Elements.Count == 0)
             {
                 return(false);
             }
         }
     }
     return(true);
 }
Ejemplo n.º 3
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;
 }
 /// <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);
 }
 /// <summary>
 /// add element
 /// </summary>
 /// <param name="element">element</param>
 /// <returns>index</returns>
 public int Add(RTFDomElement element )
 {
     return this.List.Add( element );
 }
 /// <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);
 }
Ejemplo n.º 7
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);
 }
 /// <summary>
 /// delete element
 /// </summary>
 /// <param name="node">element</param>
 public void Remove(RTFDomElement node)
 {
     this.List.Remove(node);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// append child element
 /// </summary>
 /// <param name="element">child element</param>
 /// <returns>index of element</returns>
 public void AppendChild(RTFDomElement element)
 {
     CheckLocked();
     element.Parent = this;
     element.OwnerDocument = _myOwnerDocument;
     _myElements.Add(element);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// delete element
 /// </summary>
 /// <param name="node">element</param>
 public void Remove(RTFDomElement node)
 {
     this.List.Remove(node);
 }
Ejemplo n.º 11
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));
 }
Ejemplo n.º 12
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);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// add element
 /// </summary>
 /// <param name="element">element</param>
 /// <returns>index</returns>
 public int Add(RTFDomElement element)
 {
     return(this.List.Add(element));
 }