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最新的,則會ThreadPool在上叫用回呼。If there is no current SynchronizationContext at the time of construction, the callbacks will be invoked on the ThreadPool.

如需詳細資訊和程式碼範例,請參閱4.5 中的 Async 一文:在 .NET Framework 的 blog 中啟用非同步 api 的進度和取消。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 的淺層複本 (Shallow Copy)。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.

適用於