示例#1
0
        /// <summary>
        /// </summary>
        /// <param name="e"> </param>
        /// <param name="tagname"> </param>
        /// <param name="es"> </param>
        /// <param name="traverseChildren"> </param>
        /// <returns> </returns>
        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;
        }
示例#2
0
        /// <summary>
        /// </summary>
        /// <param name="e"> </param>
        /// <param name="type"> </param>
        /// <param name="es"> </param>
        /// <param name="traverseChildren"> </param>
        /// <returns> </returns>
        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;
        }