DispatcherOperation DispatcherOperation DispatcherOperation DispatcherOperation Class

定義

表示物件,這個物件可用來與已張貼至 Dispatcher 佇列的作業互動。Represents an object that is used to interact with an operation that has been posted to the Dispatcher queue.

public ref class DispatcherOperation
public class DispatcherOperation
type DispatcherOperation = class
Public Class DispatcherOperation
繼承
DispatcherOperationDispatcherOperationDispatcherOperationDispatcherOperation
衍生

備註

BeginInvoke 傳回DispatcherOperation物件時呼叫它。BeginInvoke returns a DispatcherOperation object when it is called.

DispatcherOperation物件可用來委派進行互動上Dispatcher佇列,例如變更作業的優先順序或中止作業。The DispatcherOperation object can be used to interact with the delegate on the Dispatcher queue, such as changing the priority of the operation or aborting the operation.

若要取得叫用委派的傳回值,請使用Result屬性。To obtain the return value of the invoked delegate, use the Result property.

DispatcherOperation不是以例外狀況處理的界限。The DispatcherOperation is not an exception handling boundary. 這表示例外狀況會由Dispatcher並不會保留作業。This means that exceptions are handled by the Dispatcher and are not preserved by the operation.

屬性

Dispatcher Dispatcher Dispatcher Dispatcher

取得張貼作業所至的 DispatcherGets the Dispatcher that the operation was posted to.

Priority Priority Priority Priority

取得或設定作業在 Dispatcher 佇列中的優先權。Gets or sets the priority of the operation in the Dispatcher queue.

Result Result Result Result

取得作業完成後的結果。Gets the result of the operation after it has completed.

Status Status Status Status

取得作業的目前狀態。Gets the current status of the operation.

Task Task Task Task

取得 Task<TResult> 物件,表示目前的作業。Gets a Task<TResult> that represents the current operation.

方法

Abort() Abort() Abort() Abort()

中止作業。Aborts the operation.

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

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetAwaiter() GetAwaiter() GetAwaiter() GetAwaiter()

傳回非同步作業完成時會通知的物件。Returns an object that is notified when the asynchronous operation is finished.

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)
InvokeDelegateCore() InvokeDelegateCore() InvokeDelegateCore() InvokeDelegateCore()

開始與這個 DispatcherOperation 相關聯的作業。Begins the operation that is associated with this DispatcherOperation.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)
Wait() Wait() Wait() Wait()

等待作業完成Waits for the operation to complete

Wait(TimeSpan) Wait(TimeSpan) Wait(TimeSpan) Wait(TimeSpan)

等待作業在指定的時間內完成。Waits for the operation to complete in the specified period of time.

事件

Aborted Aborted Aborted Aborted

發生於作業已中止時。Occurs when the operation is aborted.

Completed Completed Completed Completed

發生於作業已經完成時。Occurs when the operation has completed.

適用於