C# Class Progression.Progress

显示文件 Open project: scottrippey/Progression

Public Methods

Method Description
BeginCustomTask ( IProgressCalculator calculator ) : ProgressTask

Starts a task using a custom progress calculator.

BeginFixedTask ( int steps ) : ProgressTask

Starts a task with a specific number of steps.

BeginUnknownTask ( int estimatedSteps, float estimatedWeight ) : ProgressTask

Starts a task with an unknown number of steps. As tasks complete, the progress will get nearer completion, but will never reach 100%.

BeginWeightedTask ( ) : ProgressTask

Starts a task with a specific number of steps. Progress is calculated proportionally for each step.

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 ProgressChanged events.

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.

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.

SetTaskKey ( string newTaskKey ) : ProgressTask

Changes the current task's TaskKey. Returns the current progress task, so that methods may be chained.

SetTaskKey ( string newTaskKey, object newTaskArg ) : ProgressTask

Changes the current task's TaskKey. Returns the current progress task, so that methods may be chained.

Private Methods

Method Description
GetCurrentTask ( ) : ProgressTask

Returns the top of the Progress stack. If the top is null, throws an appropriate exception.

Method Details

BeginCustomTask() public static method

Starts a task using a custom progress calculator.
public static BeginCustomTask ( IProgressCalculator calculator ) : ProgressTask
calculator IProgressCalculator Any custom progress calculator
return Progression.Core.ProgressTask

BeginFixedTask() public static method

Starts a task with a specific number of steps.
public static BeginFixedTask ( int steps ) : ProgressTask
steps int The number of steps to be performed.
return Progression.Core.ProgressTask

BeginUnknownTask() public static method

Starts a task with an unknown number of steps. As tasks complete, the progress will get nearer completion, but will never reach 100%.
public static BeginUnknownTask ( int estimatedSteps, float estimatedWeight ) : ProgressTask
estimatedSteps int /// Determines how "unknown" progress is calculated. This should be a rough estimate of the number of steps expected. /// As steps are completed, progress gets closer to 100%, but never reaches it. ///
estimatedWeight float /// A value between 0.0 and 1.0 that determines how much weight to place on the estimated steps. /// For example, if estimatedSteps is 100 and estimatedWeight is .75, /// then when 100 steps have completed, progress will be at 75%. /// /// This value cannot equal 0.0 or 1.0. ///
return Progression.Core.ProgressTask

BeginWeightedTask() public static method

Starts a task with a specific number of steps. Progress is calculated proportionally for each step.
public static BeginWeightedTask ( ) : ProgressTask
return Progression.Core.ProgressTask

EndTask() public static method

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

NextStep() public static method

Advances the current progress task to the next step. Fires ProgressChanged events.
public static NextStep ( ) : void
return void

SetCallback() public static 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 static 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 Progression.Core.ProgressTask

SetMaxDepth() public static 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 static 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 Progression.Core.ProgressTask

SetTaskKey() public static method

Changes the current task's TaskKey. Returns the current progress task, so that methods may be chained.
public static SetTaskKey ( string newTaskKey ) : ProgressTask
newTaskKey string Identifies the task being performed. Can be used for displaying progress.
return Progression.Core.ProgressTask

SetTaskKey() public static method

Changes the current task's TaskKey. Returns the current progress task, so that methods may be chained.
public static 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 Progression.Core.ProgressTask