예제 #1
0
        /// <summary>
        /// Searches for the table which embedds the given element.
        /// If the start element is a TABLE element, this one is returned.
        /// </summary>
        public static HtmlTable FindEmbeddingTable(this IHtmlElement start)
        {
            start.Require(x => start != null);

            if (start.TagName == "TABLE")
            {
                return(new HtmlTable(start));
            }

            var table = start.FindParent(p => p.TagName == "TABLE");

            return(table == null ? null : new HtmlTable(table));
        }
예제 #2
0
파일: HtmlTable.cs 프로젝트: riyanhax/Maui
        /// <summary>
        /// Returns the TR element embedding the given element.
        /// If the given element itself is a TR, this one is returned.
        /// </summary>
        public static IHtmlElement GetEmbeddingTR(IHtmlElement e)
        {
            e.Require(x => e != null);

            if (e.TagName == "TR")
            {
                return(e);
            }
            else
            {
                var parent = e.FindParent(p => p.TagName == "TR", p => e.IsTableOrTBody());
                return(parent == null ? null : parent);
            }
        }
예제 #3
0
파일: HtmlTable.cs 프로젝트: bg0jr/Maui
        /// <summary>
        /// Returns the TR element embedding the given element.
        /// If the given element itself is a TR, this one is returned.
        /// </summary>
        public static IHtmlElement GetEmbeddingTR( IHtmlElement e )
        {
            e.Require( x => e != null );

            if ( e.TagName == "TR" )
            {
                return e;
            }
            else
            {
                var parent = e.FindParent( p => p.TagName == "TR", p => e.IsTableOrTBody() );
                return (parent == null ? null : parent);
            }
        }