コード例 #1
0
ファイル: DomElement.cs プロジェクト: robertmuehsig/XamlCSS
        public IList <IDomElement <TDependencyObject> > QuerySelectorAllWithSelf(StyleSheet styleSheet, ISelector selector)
        {
            // var selector = cachedSelectorProvider.GetOrAdd(selectors);
            var check = "StyleInfo check".Measure(() =>
            {
                if (StyleInfo.CurrentStyleSheet != styleSheet ||
                    StyleInfo.DoMatchCheck == SelectorType.None)
                {
                    return(new List <IDomElement <TDependencyObject> >());
                }
                return(null);
            });

            if (check != null)
            {
                return(check);
            }

            var res = "ROOT QuerySelectorAll".Measure(() => ChildNodes.QuerySelectorAll(styleSheet, selector));

            "match this".Measure(() =>
            {
                var match = Matches(styleSheet, selector);
                if (match.IsSuccess)
                {
                    res.Add(this);
                }
            });

            return(res);
        }
コード例 #2
0
ファイル: DomElement.cs プロジェクト: Taikatou/XamlCSS
        public IHtmlCollection <IElement> QuerySelectorAll(string selectors)
        {
            if (selectors.Contains("|"))
            {
                selectors = selectors.Replace("|", "\\:");
            }

            return(CreateCollection(ChildNodes.QuerySelectorAll(selectors, Parser)));
        }
コード例 #3
0
        public IHtmlCollection <IElement> QuerySelectorAllWithSelf(string selectors)
        {
            var selector = cachedSelectorProvider.GetOrAdd(selectors, parser.ParseSelector);

            var res = ChildNodes.QuerySelectorAll(selector);

            if (this.Matches(selectors))
            {
                res.Add(this);
            }

            return(CreateCollection(res));
        }
コード例 #4
0
ファイル: DomElement.cs プロジェクト: Taikatou/XamlCSS
        public IHtmlCollection <IElement> QuerySelectorAllWithSelf(string selectors)
        {
            if (selectors.Contains("|"))
            {
                selectors = selectors.Replace("|", "\\:");
            }

            var res = ChildNodes.QuerySelectorAll(selectors, Parser);

            if (this.Matches(selectors))
            {
                res.Add(this);
            }

            return(CreateCollection(res));
        }
コード例 #5
0
 /// <summary>
 /// Returns a list of the elements within the document (using
 /// depth-first pre-order traversal of the document's nodes) that match
 /// the specified group of selectors.
 /// </summary>
 /// <param name="selectors">
 /// A string containing one or more CSS selectors separated by commas.
 /// </param>
 /// <returns>A collection of HTML elements.</returns>
 public IHtmlCollection <IElement> QuerySelectorAll(String selectors)
 {
     return(ChildNodes.QuerySelectorAll(selectors));
 }
コード例 #6
0
        public IHtmlCollection <IElement> QuerySelectorAll(string selectors)
        {
            var selector = cachedSelectorProvider.GetOrAdd(selectors, parser.ParseSelector);

            return(CreateCollection(ChildNodes.QuerySelectorAll(selector)));
        }
コード例 #7
0
 public IHtmlCollection <IElement> QuerySelectorAll(String selectors) => ChildNodes.QuerySelectorAll(selectors, null);
コード例 #8
0
ファイル: DomElement.cs プロジェクト: robertmuehsig/XamlCSS
        public IList <IDomElement <TDependencyObject> > QuerySelectorAll(StyleSheet styleSheet, ISelector selector)
        {
            // var selector = cachedSelectorProvider.GetOrAdd(selectors);

            return(ChildNodes.QuerySelectorAll(styleSheet, selector));
        }