Table of Contents

Struct TaskSnapshot

Namespace
NanoByte.Common.Tasks
Assembly
NanoByte.Common.dll

Represents a progress snapshot of an ITask.

[Serializable]
public readonly record struct TaskSnapshot
Extension Methods

Constructors

TaskSnapshot(TaskState, bool, long, long)

Represents a progress snapshot of an ITask.

public TaskSnapshot(TaskState State, bool UnitsByte = false, long UnitsProcessed = 0, long UnitsTotal = -1)

Parameters

State TaskState

The current State of the task.

UnitsByte bool

true if UnitsProcessed and UnitsTotal are measured in bytes; false if they are measured in generic units.

UnitsProcessed long

The number of units that have been processed so far.

UnitsTotal long

The total number of units that are to be processed; -1 for unknown.

Properties

State

The current State of the task.

public TaskState State { get; init; }

Property Value

TaskState

UnitsByte

true if UnitsProcessed and UnitsTotal are measured in bytes; false if they are measured in generic units.

public bool UnitsByte { get; init; }

Property Value

bool

UnitsProcessed

The number of units that have been processed so far.

public long UnitsProcessed { get; init; }

Property Value

long

UnitsTotal

The total number of units that are to be processed; -1 for unknown.

public long UnitsTotal { get; init; }

Property Value

long

Value

The progress of the task as a value between 0 and 1; -1 when unknown.

public double Value { get; }

Property Value

double

Methods

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.