HtmlElement.Net
Public Member Functions | List of all members
HtmlElements.Extensions.CommandBuilder< TTarget > Class Template Reference

Crates repeatable command being evaluated until command condition became true. More...

Public Member Functions

 CommandBuilder ()
 Create new instance of command builder More...
 
CommandBuilder< TTarget > Execute (Action< TTarget > command)
 Set command to be executed on target More...
 
CommandBuilder< TTarget > Execute (Action command)
 Set command which does not require a target More...
 
CommandBuilder< TTarget > On (TTarget target)
 Set command target. Synonym to WithTarget More...
 
CommandBuilder< TTarget > For (TimeSpan commandTimeout)
 Set command timeout. Synonym to WithTimeout More...
 
CommandBuilder< TTarget > Every (TimeSpan pollingInterval)
 Set command polling interval. Synonym to WithInterval More...
 
CommandBuilder< TTarget > WithMessage (string errorMessage)
 Set message used to create exception when command times out More...
 
CommandBuilder< TTarget > WithTarget (TTarget target)
 Set command target More...
 
CommandBuilder< TTarget > WithInterval (TimeSpan pollingInterval)
 Set command polling interval More...
 
CommandBuilder< TTarget > WithTimeout (TimeSpan commandTimeout)
 Set command timeout More...
 
CommandBuilder< TTarget > Ignoring (params Type[] exceptions)
 Set types of exception which should be ignored when thrown by a command More...
 
void Until (Predicate< TTarget > condition)
 Start execution loop in which command will be evaluated until condition evaluates to true or command timeout expires or command throw unexpected (not from ignore list) exception More...
 
void Until (Func< bool > condition)
 Start execution loop in which command will be evaluated until condition evaluates to true or command timeout expires or command throw unexpected (not from ignore list) exception More...
 

Detailed Description

Crates repeatable command being evaluated until command condition became true.

Template Parameters
TTargetCommand target type

Constructor & Destructor Documentation

◆ CommandBuilder()

Create new instance of command builder

Member Function Documentation

◆ Every()

CommandBuilder<TTarget> HtmlElements.Extensions.CommandBuilder< TTarget >.Every ( TimeSpan  pollingInterval)

Set command polling interval. Synonym to WithInterval

Parameters
pollingIntervalDelay between sequential command executions
Returns
Current builder instance

◆ Execute() [1/2]

CommandBuilder<TTarget> HtmlElements.Extensions.CommandBuilder< TTarget >.Execute ( Action  command)

Set command which does not require a target

Parameters
commandCommand to execute
Returns
Current builder instance

◆ Execute() [2/2]

CommandBuilder<TTarget> HtmlElements.Extensions.CommandBuilder< TTarget >.Execute ( Action< TTarget >  command)

Set command to be executed on target

Parameters
commandCommand to execute
Returns
Current builder instance

◆ For()

CommandBuilder<TTarget> HtmlElements.Extensions.CommandBuilder< TTarget >.For ( TimeSpan  commandTimeout)

Set command timeout. Synonym to WithTimeout

Parameters
commandTimeoutCommand expiration timeout
Returns
Current builder instance

◆ Ignoring()

CommandBuilder<TTarget> HtmlElements.Extensions.CommandBuilder< TTarget >.Ignoring ( params Type[]  exceptions)

Set types of exception which should be ignored when thrown by a command

Parameters
exceptionsException types to ignore
Returns
Current builder instance

◆ On()

CommandBuilder<TTarget> HtmlElements.Extensions.CommandBuilder< TTarget >.On ( TTarget  target)

Set command target. Synonym to WithTarget

Parameters
targetCommand target
Returns
Current builder instance

◆ Until() [1/2]

void HtmlElements.Extensions.CommandBuilder< TTarget >.Until ( Func< bool >  condition)

Start execution loop in which command will be evaluated until condition evaluates to true or command timeout expires or command throw unexpected (not from ignore list) exception

Parameters
conditionPredicate telling weather command should be evaluated again

◆ Until() [2/2]

void HtmlElements.Extensions.CommandBuilder< TTarget >.Until ( Predicate< TTarget >  condition)

Start execution loop in which command will be evaluated until condition evaluates to true or command timeout expires or command throw unexpected (not from ignore list) exception

Parameters
conditionPredicate telling weather command should be evaluated again

◆ WithInterval()

CommandBuilder<TTarget> HtmlElements.Extensions.CommandBuilder< TTarget >.WithInterval ( TimeSpan  pollingInterval)

Set command polling interval

Parameters
pollingIntervalDelay between sequential command executions
Returns
Current builder instance

◆ WithMessage()

CommandBuilder<TTarget> HtmlElements.Extensions.CommandBuilder< TTarget >.WithMessage ( string  errorMessage)

Set message used to create exception when command times out

Parameters
errorMessageError message
Returns
Current builder instance

◆ WithTarget()

CommandBuilder<TTarget> HtmlElements.Extensions.CommandBuilder< TTarget >.WithTarget ( TTarget  target)

Set command target

Parameters
targetCommand target
Returns
Current builder instance

◆ WithTimeout()

CommandBuilder<TTarget> HtmlElements.Extensions.CommandBuilder< TTarget >.WithTimeout ( TimeSpan  commandTimeout)

Set command timeout

Parameters
commandTimeoutCommand expiration timeout
Returns
Current builder instance