Represents a progress task.
Properties
Description
: stringGets or sets the task description.
ElapsedTime
: TimeSpan?Gets the elapsed time.
HideWhenCompleted
: bool?Gets or sets a value indicating whether to override the default hiding behavior of this task when completed.
Id
: intGets the task ID.
IsFinished
: boolGets a value indicating whether or not the task has finished.
IsIndeterminate
: boolGets or sets a value indicating whether the ProgressBar shows actual values or generic, continuous progress feedback.
IsStarted
: boolGets a value indicating whether or not the task has started.
MaxSamplesKept
: intGets or sets the maximum number of samples to keep for calculating speed and estimated time remaining. If set to 0, no samples are kept.
MaxSamplingAge
: TimeSpanGets or sets the maximum age of samples kept for calculating speed and estimated time remaining. Samples older than this value are discarded to more accurately reflect the current speed.
MaxTimeForSpeedCache
: TimeSpanGets or sets the maximum time a calculated speed value is cached. When estimating speed, if the oldest sample is older than this value, the current time is used as the end of the timespan instead. This causes the predicted speed to naturally decay if no new samples are received.
MaxValue
: doubleGets or sets the max value of the task.
Percentage
: doubleGets the percentage done of the task.
RemainingTime
: TimeSpan?Gets the remaining time.
Speed
: double?Gets the speed measured in steps/second.
StartTime
: DateTime?Gets the start time of the task.
State
: ProgressTaskStateGets the task state.
StopTime
: DateTime?Gets the stop time of the task.
Tag
: objectGets or sets optional user tag data.
Value
: doubleGets or sets the value of the task.
Methods
public void Increment(double value)
Increments the task's value.
Parameters:
value (double)public void StartTask()
Starts the task.
public void StopTask()
Stops and marks the task as finished.
Extension Methods
ProgressTask Description(this ProgressTask task, string description)Sets the task description.
Returns:
The same instance so that multiple calls can be chained.
ProgressTask HideWhenCompleted(this ProgressTask task, bool hideWhenCompleted)Sets whether to override the default hiding behavior of this task when completed.
Returns:
The same instance so that multiple calls can be chained.
ProgressTask IsIndeterminate(this ProgressTask task, bool indeterminate)Sets whether the task is considered indeterminate or not.
Returns:
The same instance so that multiple calls can be chained.
ProgressTask MaxValue(this ProgressTask task, double value)Sets the max value of the task.
Returns:
The same instance so that multiple calls can be chained.
ProgressTask Tag(this ProgressTask task, object tag)Sets the task's tag.
Returns:
The same instance so that multiple calls can be chained.
ProgressTask Value(this ProgressTask task, double value)Sets the value of the task.
Returns:
The same instance so that multiple calls can be chained.