Table of Contents

Class DeferredProgress<T>

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

Remembers the latest call made to Report(T). Forwards that call (if any) and all future calls to a target IProgress<T> implementation once it is set.

public class DeferredProgress<T>

Type Parameters

T

The type of progress update value.

Inheritance
DeferredProgress<T>
Extension Methods

Remarks

If Report(T) and SetTarget(IProgress<T>) are called on different threads individual progress reports may be lost. This tradeoff is made intentionally to avoid locking for better performance.

Methods

Report(T)

Reports a progress update.

public void Report(T value)

Parameters

value T

The value of the updated progress.

SetTarget(IProgress<T>)

Sets the target IProgress<T> implementation to forward Report(T) calls to.

public void SetTarget(IProgress<T> target)

Parameters

target IProgress<T>

Exceptions

InvalidOperationException

The target is already set.