C# Class Progression.Core.ProgressTask

Inheritance: IDisposable
Mostrar archivo Open project: scottrippey/Progression Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void

Ends this task unsuccessfully, meaning that the 100% complete event will not fire. Call Progress.EndTask() to successfully end this task with 100% progress.

EnablePolling ( ) : ProgressTask

Enables progress polling. Use CurrentProgress to retrieve the task's current progress. Returns the current progress task, so that methods may be chained.

EnablePolling ( ProgressDepth maximumDepth ) : ProgressTask

Enables progress polling. Use CurrentProgress to retrieve the task's current progress. Returns the current progress task, so that methods may be chained.

EnablePolling ( int maximumDepth ) : ProgressTask

Enables progress polling. Use CurrentProgress to retrieve the task's current progress. Returns the current progress task, so that methods may be chained.

EndTask ( ) : void

Ends this task successfully, meaning that the 100% complete event will fire. This should be called before the task is disposed.

NextStep ( ) : void

Advances the current progress task to the next step. Fires the progressChangedCallback callback.

NextStep ( object currentStepArg ) : void

Advances the current progress task to the next step. Fires the progressChangedCallback callback.

ProgressTask ( IProgressCalculator calculator ) : System

Pushes a new task to the top of the stack.

SetCallback ( ProgressChangedCallback callback ) : ProgressTask

Attaches the callback to fire when progress is reported. This is usually called at the beginning of the task. Returns the current progress task, so that methods may be chained.

SetCallback ( ProgressChangedCallback callback, ProgressDepth maxDepth ) : ProgressTask

Attaches the callback to fire when progress is reported. This is usually called at the beginning of the task. Returns the current progress task, so that methods may be chained.

SetCallbackEnded ( ProgressChangedCallback callback ) : ProgressTask

Attaches the callback to fire when the progress task ends (successfully or not). This is usually attached at the beginning of the task. Returns the current progress task, so that methods may be chained.

SetMaxDepth ( ProgressDepth maxDepth ) : ProgressTask

An integer value that determines the maximum number of nested progress tasks. Progress reported at deeper levels will be ignored. All negative values are equivalent to "Auto". Returns the current progress task, so that methods may be chained.

SetMaxDepth ( int maxDepth ) : ProgressTask

An integer value that determines the maximum number of nested progress tasks. Progress reported at deeper levels will be ignored. All negative values are equivalent to "Auto". Returns the current progress task, so that methods may be chained.

SetTaskKey ( string newTaskKey ) : ProgressTask

Changes the current task's TaskKey. This should only be called once per Task. Returns the current progress task, so that methods may be chained.

SetTaskKey ( string newTaskKey, object newTaskArg ) : ProgressTask

Changes the current task's TaskKey. This should only be called once per Task. Returns the current progress task, so that methods may be chained.

ToString ( ) : string

Private Methods

Method Description
EndTask ( bool completedSuccessfully ) : void

Ends this task, firing the 100% complete event if necessary, and pops the Progress stack.

OnProgressChanged ( object currentStepArg ) : void

Calculates the current progress, and invokes the callback for the current task and all parent tasks.

Method Details

Dispose() public method

Ends this task unsuccessfully, meaning that the 100% complete event will not fire. Call Progress.EndTask() to successfully end this task with 100% progress.
public Dispose ( ) : void
return void

EnablePolling() public method

Enables progress polling. Use CurrentProgress to retrieve the task's current progress. Returns the current progress task, so that methods may be chained.
public EnablePolling ( ) : ProgressTask
return ProgressTask

EnablePolling() public method

Enables progress polling. Use CurrentProgress to retrieve the task's current progress. Returns the current progress task, so that methods may be chained.
public EnablePolling ( ProgressDepth maximumDepth ) : ProgressTask
maximumDepth ProgressDepth
return ProgressTask

EnablePolling() public method

Enables progress polling. Use CurrentProgress to retrieve the task's current progress. Returns the current progress task, so that methods may be chained.
public EnablePolling ( int maximumDepth ) : ProgressTask
maximumDepth int
return ProgressTask

EndTask() public method

Ends this task successfully, meaning that the 100% complete event will fire. This should be called before the task is disposed.
public EndTask ( ) : void
return void

NextStep() public method

Advances the current progress task to the next step. Fires the progressChangedCallback callback.
public NextStep ( ) : void
return void

NextStep() public method

Advances the current progress task to the next step. Fires the progressChangedCallback callback.
public NextStep ( object currentStepArg ) : void
currentStepArg object This argument will be passed to the callback. Default is null.
return void

ProgressTask() public method

Pushes a new task to the top of the stack.
public ProgressTask ( IProgressCalculator calculator ) : System
calculator IProgressCalculator
return System

SetCallback() public method

Attaches the callback to fire when progress is reported. This is usually called at the beginning of the task. Returns the current progress task, so that methods may be chained.
public SetCallback ( ProgressChangedCallback callback ) : ProgressTask
callback ProgressChangedCallback Attach a callback to the ProgressChanged event
return ProgressTask

SetCallback() public method

Attaches the callback to fire when progress is reported. This is usually called at the beginning of the task. Returns the current progress task, so that methods may be chained.
public SetCallback ( ProgressChangedCallback callback, ProgressDepth maxDepth ) : ProgressTask
callback ProgressChangedCallback Attach a callback to the ProgressChanged event
maxDepth ProgressDepth An integer value that determines the maximum number of nested progress tasks. Progress reported at deeper levels will be ignored. All negative values are equivalent to "Auto".
return ProgressTask

SetCallbackEnded() public method

Attaches the callback to fire when the progress task ends (successfully or not). This is usually attached at the beginning of the task. Returns the current progress task, so that methods may be chained.
public SetCallbackEnded ( ProgressChangedCallback callback ) : ProgressTask
callback ProgressChangedCallback Attach a callback to the ProgressEnded event
return ProgressTask

SetMaxDepth() public method

An integer value that determines the maximum number of nested progress tasks. Progress reported at deeper levels will be ignored. All negative values are equivalent to "Auto". Returns the current progress task, so that methods may be chained.
public SetMaxDepth ( ProgressDepth maxDepth ) : ProgressTask
maxDepth ProgressDepth An integer value that determines the maximum number of nested progress tasks. Progress reported at deeper levels will be ignored. All negative values are equivalent to "Auto".
return ProgressTask

SetMaxDepth() public method

An integer value that determines the maximum number of nested progress tasks. Progress reported at deeper levels will be ignored. All negative values are equivalent to "Auto". Returns the current progress task, so that methods may be chained.
public SetMaxDepth ( int maxDepth ) : ProgressTask
maxDepth int An integer value that determines the maximum number of nested progress tasks. Progress reported at deeper levels will be ignored. All negative values are equivalent to "Auto".
return ProgressTask

SetTaskKey() public method

Changes the current task's TaskKey. This should only be called once per Task. Returns the current progress task, so that methods may be chained.
public SetTaskKey ( string newTaskKey ) : ProgressTask
newTaskKey string Identifies the task being performed. Can be used for displaying progress.
return ProgressTask

SetTaskKey() public method

Changes the current task's TaskKey. This should only be called once per Task. Returns the current progress task, so that methods may be chained.
public SetTaskKey ( string newTaskKey, object newTaskArg ) : ProgressTask
newTaskKey string Identifies the task being performed. Can be used for displaying progress.
newTaskArg object Provides additional info about the task being performed
return ProgressTask

ToString() public method

public ToString ( ) : string
return string