コード例 #1
0
        private void SetTableVisibility(HtmlElement table, bool makeVisible)
        {
            HtmlElement elementById = base.Document.GetElementById(table.Id + "ud");

            if (elementById != null)
            {
                bool flag = elementById.InnerText == "6";
                if (makeVisible == flag)
                {
                    elementById.InnerText = flag ? "5" : "6";
                    table.Style           = flag ? "border-bottom: 2px solid" : "border-bottom: dashed 2px";
                    HtmlElementCollection children = table.Children;
                    if ((children.Count == 1) && (children[0].TagName.ToUpperInvariant() == "TBODY"))
                    {
                        children = children[0].Children;
                    }
                    IEnumerable <HtmlElement> source = children.OfType <HtmlElement>();
                    if (source.Count <HtmlElement>() >= 2)
                    {
                        foreach (HtmlElement element2 in source.Skip <HtmlElement>(1))
                        {
                            if ((element2.TagName.ToUpperInvariant() == "TR") && !((element2.Id != null) && element2.Id.StartsWith("sum")))
                            {
                                element2.Style = flag ? "" : "display:none";
                            }
                        }
                    }
                }
            }
        }
コード例 #2
0
        public static void MergeCollection(this List <HtmlElement> list, HtmlElementCollection other)
        {
            IEnumerator <HtmlElement> ie = other.OfType <HtmlElement>().GetEnumerator();

            while (ie.MoveNext())
            {
                list.Add(ie.Current);
            }
        }
コード例 #3
0
        public static List <HtmlElement> MergeCollection(this HtmlElementCollection hec, HtmlElementCollection other)
        {
            List <HtmlElement>        list = new List <HtmlElement>();
            IEnumerator <HtmlElement> ie   = hec.OfType <HtmlElement>().GetEnumerator();

            while (ie.MoveNext())
            {
                list.Add(ie.Current);
            }
            IEnumerator <HtmlElement> ie1 = other.OfType <HtmlElement>().GetEnumerator();

            while (ie1.MoveNext())
            {
                list.Add(ie1.Current);
            }
            return(list);
        }