Show / Hide Table of Contents

Class TaskSnapshot

Represents a progress snapshot of an ITask.

Inheritance
Object
TaskSnapshot
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

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

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

Extension Methods

UpdateUtils.To<TIn, TOut>(TIn, Func<TIn, TOut>)
JsonStorage.SaveJson<T>(T, Stream)
JsonStorage.SaveJson<T>(T, String)
JsonStorage.ToJsonString<T>(T)
JsonStorage.ReparseAsJson<T>(Object)
JsonStorage.ReparseAsJson<T>(Object, T)
XmlStorage.SaveXml(Object, Stream, String)
XmlStorage.SaveXml<T>(T, String, String)
XmlStorage.ToXmlString(Object, String)
ConversionUtils.ConvertToString<TType>(TType)
In This Article
Back to top Copyright Bastian Eicher