Skip to the content.

PromptPlus API:IControlWait

Build Publish License NuGet Downloads

Back to List Api

IControlWait<T>

Namespace: PPlus.Controls

Represents the interface with all Methods of the WaitTimer/WaitProcess control

public interface IControlWait<T> : IPromptControls<ResultWaitProcess<T>>

Type Parameters

T
typeof return

Implements IPromptControls<ResultWaitProcess<T>>

Methods

AddStep(StepMode, params Action<EventWaitProcess<T>, CancellationToken>[])

Add list of tasks to execute.

IControlWait<T> AddStep(StepMode stepMode, params Action<EventWaitProcess<T>, CancellationToken>[] process)

Parameters

stepMode StepMode
Sequential or parallel execution

process Action<EventWaitProcess<T>, CancellationToken>[]
list of tasks

Returns

IControlWait<T>

AddStep(StepMode, String, String, params Action<EventWaitProcess<T>, CancellationToken>[])

Add list of tasks to execute with title and description

IControlWait<T> AddStep(StepMode stepMode, string id, string label, params Action<EventWaitProcess<T>, CancellationToken>[] process)

Parameters

stepMode StepMode
Sequential or parallel execution

id String
Id of tasks

label String
Label of tasks

process Action<EventWaitProcess<T>, CancellationToken>[]
list of tasks

Returns

IControlWait<T>

Config(Action<IPromptConfig>)

Custom config the control.

IControlWait<T> Config(Action<IPromptConfig> context)

Parameters

context Action<IPromptConfig>
Action to apply changes. IPromptConfig

Returns

IControlWait<T>

Context(T)

Set Contex value for all tasks

IControlWait<T> Context(T value)

Parameters

value T
Context value

Returns

IControlWait<T>

Finish(String)

Finish answer to show when Wait process is completed.

IControlWait<T> Finish(string text)

Parameters

text String
Text Finish answer

Returns

IControlWait<T>

Interaction<T1>(IEnumerable<T1>, Action<IControlWait<T>, T1>)

Execute a action foreach item of colletion passed as a parameter

IControlWait<T> Interaction<T1>(IEnumerable<T1> values, Action<IControlWait<T>, T1> action)

Type Parameters

T1

Parameters

values IEnumerable<T1>
Colletion for interaction

action Action<IControlWait<T>, T1>
Action to execute

Returns

IControlWait<T>

MaxDegreeProcess(Int32)

Maximum number of concurrent tasks enable. Default vaue is number of processors.

IControlWait<T> MaxDegreeProcess(int value)

Parameters

value Int32
Number of concurrent tasks

Returns

IControlWait<T>

ShowElapsedTime(Boolean)

Define if show Elapsed Time for each task.Default false.

IControlWait<T> ShowElapsedTime(bool value)

Parameters

value Boolean
show Elapsed Time

Returns

IControlWait<T>

Spinner(SpinnersType, Nullable<Int32>, IEnumerable<String>)

Overwrite SpinnersType. Default value is SpinnersType.Ascii
When use custom spinner, if has unicode values console does not support it, the rendering may not be as expected

IControlWait<T> Spinner(SpinnersType spinnersType, Nullable<Int32> speedAnimation, IEnumerable<String> customspinner)

Parameters

spinnersType SpinnersType
The SpinnersType

speedAnimation Nullable<Int32>
Number of mileseconds foreach iteration of spinner. Valid only to SpinnersType.custom, otherwise will be ignored

customspinner IEnumerable<String>
IEnumerable values for custom spinner. Valid only to SpinnersType.custom, otherwise will be ignored

Returns

IControlWait<T>

Styles(WaitStyles, Style)

Overwrite Styles

IControlWait<T> Styles(WaitStyles content, Style value)

Parameters

content WaitStyles
WaitStyles of content

value Style
Style

Returns

IControlWait<T>

TaskTitle(String)

Overwrite Task Title . Default task title comes from the embedded resource.

IControlWait<T> TaskTitle(string value)

Parameters

value String
TaskTitle Task

Returns

IControlWait<T>


Back to List Api