Exemple #1
0
 private ElementList _SelectElements(Element e, string tagname, ElementList es, bool traverseChildren)
 {
     if (e.ChildNodes.Count > 0)
     {
         foreach (Node n in e.ChildNodes)
         {
             if (n.NodeType == NodeType.Element)
             {
                 if (((Element)n).m_TagName == tagname)
                 {
                     es.Add(n);
                 }
                 if (traverseChildren)
                 {
                     _SelectElements((Element)n, tagname, es, true);
                 }
             }
         }
     }
     return(es);
 }
Exemple #2
0
 private ElementList _SelectElements(Element e, Type type, ElementList es, bool traverseChildren)
 {
     if (e.ChildNodes.Count > 0)
     {
         foreach (Node n in e.ChildNodes)
         {
             if (n.NodeType == NodeType.Element)
             {
                 if (n.GetType() == type)
                 {
                     es.Add(n);
                 }
                 if (traverseChildren)
                 {
                     _SelectElements((Element)n, type, es, true);
                 }
             }
         }
     }
     return(es);
 }