Esempio n. 1
0
 /// <summary>
 /// 内部方法,添加表单域元素
 /// </summary>
 /// <param name="e"></param>
 internal void AppendElement(IHTMLFormElement e)
 {
     if (!myElements.Contains((HTMLElement)e))
     {
         myElements.Add(( HTMLElement )e);
         e.Form = this;
     }
 }
Esempio n. 2
0
 internal virtual void InnerGetAllElement(HTMLElementList list)
 {
     foreach (HTMLElement element in myChildNodes)
     {
         list.Add(element);
         if (element is HTMLContainer)
         {
             (( HTMLContainer )element).InnerGetAllElement(list);
         }
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 添加子标签对象
 /// </summary>
 /// <param name="e">对象</param>
 /// <returns>操作是否成功</returns>
 public override bool AppendChild(HTMLElement e)
 {
     if (e.TagName == StringConstTagName.Tr ||
         e.TagName == StringConstTagName.TBody)
     {
         myChildNodes.Add(e);
     }
     else
     {
         myCols.Add(e);
     }
     e.Parent        = this;
     e.OwnerDocument = myOwnerDocument;
     return(true);
 }
Esempio n. 4
0
        /// <summary>
        /// 获得所有指定名称的元素
        /// </summary>
        /// <param name="vName">名称</param>
        /// <param name="myList">保存获得到元素的列表</param>
        /// <returns>获得到元素的个数</returns>
        internal virtual int InnerGetElementsByName(string vName, HTMLElementList myList)
        {
            int iCount = 0;

            foreach (HTMLElement e in myChildNodes)
            {
                if (e.GetAttribute(StringConstAttributeName.Name) == vName)
                {
                    myList.Add(e);
                    iCount++;
                }
                if (e is HTMLContainer)
                {
                    iCount += (( HTMLContainer)e).InnerGetElementsByName(vName, myList);
                }
            }
            return(iCount);
        }
Esempio n. 5
0
        /// <summary>
        /// 获得所有指定标签名称的元素
        /// </summary>
        /// <param name="vTagName">指定的标签名称</param>
        /// <param name="myList">保存获得到元素的列表</param>
        /// <returns>获得到元素的个数</returns>
        internal virtual int InnerGetElementsByTagName(string vTagName, HTMLElementList myList)
        {
            int iCount = 0;

            foreach (HTMLElement e in myChildNodes)
            {
                if (e.TagName == vTagName)
                {
                    myList.Add(e);
                    iCount++;
                }
                if (e is HTMLContainer)
                {
                    iCount += (( HTMLContainer)e).InnerGetElementsByTagName(vTagName, myList);
                }
            }
            return(iCount);
        }
Esempio n. 6
0
 /// <summary>
 /// 内部的添加子元素
 /// </summary>
 /// <param name="e"></param>
 /// <returns></returns>
 internal bool InnerAppendChild(HTMLElement e)
 {
     if (this.CheckChildTagName(e.TagName) && e.CheckParent(this))
     {
         myChildNodes.Add(e);
         e.Parent        = this;
         e.OwnerDocument = myOwnerDocument;
         if (e is IHTMLFormElement)
         {
             HTMLElement frm = this;
             while ((frm != null) && (!(frm is HTMLFormElement)))
             {
                 frm = frm.Parent;
             }
             if (frm is HTMLFormElement)
             {
                 (( HTMLFormElement )frm).AppendElement(( IHTMLFormElement)e);
             }
         }
         return(true);
     }
     return(false);
 }