Progress<T> Progress<T> Progress<T> Progress<T> Class

定义

提供调用每个报告进度的值的回调的 IProgress<T>Provides an IProgress<T> that invokes callbacks for each reported progress value.

generic <typename T>
public ref class Progress : IProgress<T>
public class Progress<T> : IProgress<T>
type Progress<'T> = class
    interface IProgress<'T>
Public Class Progress(Of T)
Implements IProgress(Of T)

类型参数

T

指定进度报表值的类型。Specifies the type of the progress report value.

继承
Progress<T>Progress<T>Progress<T>Progress<T>
实现

注解

提供给构造函数或事件处理程序的任何处理程序注册ProgressChanged通过调用事件SynchronizationContext构造实例时,捕获实例。Any handler provided to the constructor or event handlers registered with the ProgressChanged event are invoked through a SynchronizationContext instance captured when the instance is constructed. 如果没有当前SynchronizationContext在构造时,回调会调用上ThreadPoolIf there is no current SynchronizationContext at the time of construction, the callbacks will be invoked on the ThreadPool.

有关详细信息和代码示例,请参阅文章4.5 中的异步:启用进度和异步 Api 中的取消.NET Framework 博客中。For more information and a code example, see the article Async in 4.5: Enabling Progress and Cancellation in Async APIs in the .NET Framework blog.

构造函数

Progress<T>() Progress<T>() Progress<T>() Progress<T>()

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

Progress<T>(Action<T>) Progress<T>(Action<T>) Progress<T>(Action<T>) Progress<T>(Action<T>)

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

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
OnReport(T) OnReport(T) OnReport(T) OnReport(T)

报告进度更改。Reports a progress change.

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

事件

ProgressChanged ProgressChanged ProgressChanged ProgressChanged

为每个报告进度的值引发。Raised for each reported progress value.

显式界面实现

IProgress<T>.Report(T) IProgress<T>.Report(T) IProgress<T>.Report(T) IProgress<T>.Report(T)

报告进度更改。Reports a progress change.

适用于