C# Class Fizzler.Systems.HtmlAgilityPack.HtmlNodeSelection

Selector API for HtmlNode.
For more information, see Selectors API.
Afficher le fichier Open project: atifaziz/Fizzler

Méthodes publiques

Méthode Description
CachableCompile ( string selector ) : IEnumerable>.Func

Compiles a selector. If the selector has been previously compiled then this method returns it rather than parsing and compiling the selector on each invocation.

The cache is per-thread and therefore thread-safe without lock contention.

Compile ( string selector ) : IEnumerable>.Func

Parses and compiles CSS selector text into run-time function.

Use this method to compile and reuse frequently used CSS selectors without parsing them each time.

CreateCachingCompiler ( ) : Func>>

Creates a caching selector compiler that uses a default cache strategy when the selector text is regarded as being orginally case-insensitive.

CreateCachingCompiler ( IDictionary cache ) : Func>>

Creates a caching selector compiler where the compiled selectors are maintained in a user-supplied IDictionary{TKey,TValue} instance.

If cache is null then this method uses a the Dictionary{TKey,TValue} implementation with an ordinally case-insensitive selectors text comparer.

QuerySelector ( this node, string selector ) : HtmlNode

Similar to QuerySelectorAll(HtmlNode,string) except it returns only the first element matching the supplied selector strings.

QuerySelectorAll ( this node, string selector ) : IEnumerable

Retrieves all element nodes from descendants of the starting element node that match any selector within the supplied selector strings.

QuerySelectorAll ( this node, string selector, Func compiler ) : IEnumerable

Retrieves all element nodes from descendants of the starting element node that match any selector within the supplied selector strings. An additional parameter specifies a particular compiler to use for parsing and compiling the selector.

The compiler can be null, in which case a default compiler is used. If the selector is to be used often, it is recommended to use a caching compiler such as the one supplied by CreateCachingCompiler().

Method Details

CachableCompile() public static méthode

Compiles a selector. If the selector has been previously compiled then this method returns it rather than parsing and compiling the selector on each invocation.
The cache is per-thread and therefore thread-safe without lock contention.
public static CachableCompile ( string selector ) : IEnumerable>.Func
selector string
Résultat IEnumerable>.Func

Compile() public static méthode

Parses and compiles CSS selector text into run-time function.
Use this method to compile and reuse frequently used CSS selectors without parsing them each time.
public static Compile ( string selector ) : IEnumerable>.Func
selector string
Résultat IEnumerable>.Func

CreateCachingCompiler() public static méthode

Creates a caching selector compiler that uses a default cache strategy when the selector text is regarded as being orginally case-insensitive.
public static CreateCachingCompiler ( ) : Func>>
Résultat Func>>

CreateCachingCompiler() public static méthode

Creates a caching selector compiler where the compiled selectors are maintained in a user-supplied IDictionary{TKey,TValue} instance.
If cache is null then this method uses a the Dictionary{TKey,TValue} implementation with an ordinally case-insensitive selectors text comparer.
public static CreateCachingCompiler ( IDictionary cache ) : Func>>
cache IDictionary
Résultat Func>>

QuerySelector() public static méthode

Similar to QuerySelectorAll(HtmlNode,string) except it returns only the first element matching the supplied selector strings.
public static QuerySelector ( this node, string selector ) : HtmlNode
node this
selector string
Résultat HtmlNode

QuerySelectorAll() public static méthode

Retrieves all element nodes from descendants of the starting element node that match any selector within the supplied selector strings.
public static QuerySelectorAll ( this node, string selector ) : IEnumerable
node this
selector string
Résultat IEnumerable

QuerySelectorAll() public static méthode

Retrieves all element nodes from descendants of the starting element node that match any selector within the supplied selector strings. An additional parameter specifies a particular compiler to use for parsing and compiling the selector.
The compiler can be null, in which case a default compiler is used. If the selector is to be used often, it is recommended to use a caching compiler such as the one supplied by CreateCachingCompiler().
public static QuerySelectorAll ( this node, string selector, Func compiler ) : IEnumerable
node this
selector string
compiler Func
Résultat IEnumerable