Class TaskSnapshot
Represents a progress snapshot of an ITask.
Namespace: NanoByte.Common.Tasks
Assembly: NanoByte.Common.dll
Syntax
public sealed class TaskSnapshot : ValueType
Constructors
TaskSnapshot(TaskState, Boolean, Int64, Int64)
Create a new progress snapshot.
Declaration
public TaskSnapshot(TaskState state, bool unitsByte = false, long unitsProcessed = 0L, long unitsTotal = -1L)
Parameters
Type | Name | Description |
---|---|---|
TaskState | state | The current State of the task. |
Boolean | unitsByte |
|
Int64 | unitsProcessed | The number of units that have been processed so far. |
Int64 | unitsTotal | The total number of units that are to be processed; -1 for unknown. |
Properties
State
The current State of the task.
Declaration
public TaskState State { get; }
Property Value
Type | Description |
---|---|
TaskState |
UnitsByte
true
if UnitsProcessed and UnitsTotal are measured in bytes;
false
if they are measured in generic units.
Declaration
public bool UnitsByte { get; }
Property Value
Type | Description |
---|---|
Boolean |
UnitsProcessed
The number of units that have been processed so far.
Declaration
public long UnitsProcessed { get; }
Property Value
Type | Description |
---|---|
Int64 |
UnitsTotal
The total number of units that are to be processed; -1 for unknown.
Declaration
public long UnitsTotal { get; }
Property Value
Type | Description |
---|---|
Int64 |
Value
The progress of the task as a value between 0 and 1; -1 when unknown.
Declaration
public double Value { get; }
Property Value
Type | Description |
---|---|
Double |
Methods
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |