DispatcherOperation 類別

定義

表示物件,這個物件可用來與已張貼至 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
繼承
DispatcherOperation
衍生

備註

當呼叫時,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

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

Priority

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

Result

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

Status

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

Task

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

方法

Abort()

中止作業。Aborts the operation.

Equals(Object)

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

(繼承來源 Object)
GetAwaiter()

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

GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
InvokeDelegateCore()

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

MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

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

(繼承來源 Object)
Wait()

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

Wait(TimeSpan)

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

事件

Aborted

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

Completed

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

適用於