C# Class CsQuery.Engine.PseudoSelectors

Factory class for PseudoSelectors: provides an API for managing selectors.
Exibir arquivo Open project: prepare/HTML-Renderer Class Usage Examples

Public Methods

Method Description
GetInstance ( string name ) : IPseudoSelector

Gets an instance of a named pseudoselector

GetRegisteredType ( string name ) : Type

Gets a registered pseudoclass filter type. If the name is not registered, an exception is thrown.

Register ( Assembly assembly = null ) : int

Registers all classes implementing IPseudoSelector in the namespace CsQuery.Extensions in the passed assembly. If no assembly is provided, then inspects the calling assembly instead.

This method is called when the LookForExtensions startup option is set. (This is the default setting).

Register ( string name, Type type ) : void

Registers a new PseudoSelector type by name.

TryGetInstance ( string name, IPseudoSelector &instance ) : bool

Try to gets an instance of a named pseudoclass filter.

TryGetRegisteredType ( string name, Type &type ) : bool

Try to get the type of a registered pseudoclass filter.

Unregister ( string name ) : bool

Unregisters the names pseudoclass filter.

Private Methods

Method Description
PopulateFromAssembly ( Assembly assy ) : int
PopulateInnerSelectors ( ) : void
PseudoSelectors ( ) : System
ValidateType ( Type value ) : void

Method Details

GetInstance() public method

Gets an instance of a named pseudoselector
/// Thrown when the pseudoselector does not exist ///
public GetInstance ( string name ) : IPseudoSelector
name string /// The name of the pseudoselector ///
return IPseudoSelector

GetRegisteredType() public method

Gets a registered pseudoclass filter type. If the name is not registered, an exception is thrown.
public GetRegisteredType ( string name ) : Type
name string /// The name of the pseudoselector. ///
return System.Type

Register() public method

Registers all classes implementing IPseudoSelector in the namespace CsQuery.Extensions in the passed assembly. If no assembly is provided, then inspects the calling assembly instead.
This method is called when the LookForExtensions startup option is set. (This is the default setting).
public Register ( Assembly assembly = null ) : int
assembly System.Reflection.Assembly /// The assembly to search. ///
return int

Register() public method

Registers a new PseudoSelector type by name.
/// Throws an exception when the type does not inherit IPseudoSelector. ///
public Register ( string name, Type type ) : void
name string /// The name of the pseudoselector. ///
type System.Type /// The type. ///
return void

TryGetInstance() public method

Try to gets an instance of a named pseudoclass filter.
public TryGetInstance ( string name, IPseudoSelector &instance ) : bool
name string /// The name of the pseudoselector. ///
instance IPseudoSelector /// [out] The new instance. ///
return bool

TryGetRegisteredType() public method

Try to get the type of a registered pseudoclass filter.
public TryGetRegisteredType ( string name, Type &type ) : bool
name string /// The name of the pseudoselector. ///
type System.Type /// The type. ///
return bool

Unregister() public method

Unregisters the names pseudoclass filter.
public Unregister ( string name ) : bool
name string /// The name of the pseudoselector. ///
return bool