Progress<T> 构造函数

定义

初始化 Progress<T> 对象或用指定回调初始化 Progress<T> 对象。Initializes the Progress<T> object or initializes the Progress<T> object with the specified callback.

重载

Progress<T>()

初始化 Progress<T> 对象。Initializes the Progress<T> object.

Progress<T>(Action<T>)

用指定的回调初始化 Progress<T> 对象。Initializes the Progress<T> object with the specified callback.

Progress<T>()

初始化 Progress<T> 对象。Initializes the Progress<T> object.

public:
 Progress();
public Progress ();
Public Sub New ()

Progress<T>(Action<T>)

用指定的回调初始化 Progress<T> 对象。Initializes the Progress<T> object with the specified callback.

public:
 Progress(Action<T> ^ handler);
public Progress (Action<T> handler);
new Progress<'T> : Action<'T> -> Progress<'T>
Public Sub New (handler As Action(Of T))

参数

handler
Action<T>

为每个报告的进度值调用处理程序。A handler to invoke for each reported progress value. 该处理程序会调用除了任何委托 ProgressChanged 事件注册。This handler will be invoked in addition to any delegates registered with the ProgressChanged event. 根据 SynchronizationContext 实例, Progress<T> 在构造时所捕获的实例, 该处理程序实例很有可能同时调用自身。Depending on the SynchronizationContext instance captured by the Progress<T> at construction, it is possible that this handler instance could be invoked concurrently with itself.

异常

handlernull(在 Visual Basic 中为 Nothing)。handler is null (Nothing in Visual Basic).

适用于