コード例 #1
0
        public HtmlElementCollection GetElementsByClassName(string className)
        {
            HtmlElementCollection    all   = All;
            NetHtmlElementCollection value = new NetHtmlElementCollection();

            foreach (HtmlElement el in all)
            {
                if (el.HasClassName(className))
                {
                    value.Add(el);
                }
            }
            return(value);
        }
コード例 #2
0
        public HtmlElementCollection GetElementsByClassName(string className)
        {
            HtmlElementCollection els;
            HtmlElementCollection value = new NetHtmlElementCollection();

            foreach (HtmlElement child in Children)
            {
                if (child.HasClassName(className))
                {
                    value.Add(child);
                }
                els = child.GetElementsByClassName(className);
                if (els.Count > 0)
                {
                    value.Add(els);
                }
            }
            return(value);
        }
コード例 #3
0
        public HtmlElementCollection GetElementsByName(string name)
        {
            HtmlElementCollection els;
            HtmlElementCollection value = new NetHtmlElementCollection();

            foreach (HtmlElement child in Children)
            {
                if (string.Equals(child.Name, name, StringComparison.OrdinalIgnoreCase))
                {
                    value.Add(child);
                }
                els = child.GetElementsByName(name);
                if (els.Count > 0)
                {
                    value.Add(els);
                }
            }
            return(value);
        }
コード例 #4
0
        public override HtmlElementCollection GetElementsByTagName(string tagName)
        {
            HtmlElementCollection    els;
            NetHtmlElementCollection value = new NetHtmlElementCollection();

            foreach (HtmlElement el in _list)
            {
                if (string.Equals(el.TagName, tagName, StringComparison.OrdinalIgnoreCase))
                {
                    value.Add(el);
                }
                els = el.GetElementsByTagName(tagName);
                if (els.Count > 0)
                {
                    value.Add(els);
                }
            }
            return(value);
        }
コード例 #5
0
        public override HtmlElementCollection GetElementsByClassName(string className)
        {
            HtmlElementCollection    els;
            NetHtmlElementCollection value = new NetHtmlElementCollection();

            foreach (HtmlElement el in _list)
            {
                if (el.HasClassName(className))
                {
                    value.Add(el);
                }
                els = el.GetElementsByClassName(className);
                if (els.Count > 0)
                {
                    value.Add(els);
                }
            }
            return(value);
        }
コード例 #6
0
        public override HtmlElementCollection GetElementsByTagName(string tagName)
        {
            HtmlElement              el;
            HtmlElementCollection    els;
            NetHtmlElementCollection value = new NetHtmlElementCollection();

            for (int i = 0; i < Count; ++i)
            {
                el = this[i];
                if (string.Equals(el.TagName, tagName, StringComparison.OrdinalIgnoreCase))
                {
                    value.Add(el);
                }
                els = el.GetElementsByTagName(tagName);
                if (els.Count > 0)
                {
                    value.Add(els);
                }
            }
            return(value);
        }
コード例 #7
0
        public override HtmlElementCollection GetElementsByClassName(string className)
        {
            HtmlElement              el;
            HtmlElementCollection    els;
            NetHtmlElementCollection value = new NetHtmlElementCollection();

            for (int i = 0; i < Count; ++i)
            {
                el = this[i];
                if (el.HasClassName(className))
                {
                    value.Add(el);
                }
                els = el.GetElementsByClassName(className);
                if (els.Count > 0)
                {
                    value.Add(els);
                }
            }
            return(value);
        }