Dispatcher Dispatcher Dispatcher Dispatcher Class

定義

提供管理執行緒之工作項目佇列的服務。Provides services for managing the queue of work items for a thread.

public ref class Dispatcher sealed
public sealed class Dispatcher
type Dispatcher = class
Public NotInheritable Class Dispatcher
繼承
DispatcherDispatcherDispatcherDispatcher

範例

下列範例示範如何將放入作業DispatcherThe following example shows how to place an operation onto a Dispatcher. 如需此範例的完整原始程式碼,請參閱單一執行緒應用程式與長時間執行的計算範例For the full source code of this example, see Single-Threaded Application with Long-Running Calculation Sample.

首先,建立委派會接受任何引數。First, a delegate is created that accepts no arguments.

public delegate void NextPrimeDelegate();
Public Delegate Sub NextPrimeDelegate()

接下來,BeginInvoke(DispatcherPriority, Delegate)呼叫。Next, BeginInvoke(DispatcherPriority, Delegate) is called. 此呼叫BeginInvoke(DispatcherPriority, Delegate)採用兩個參數: 的優先權,它會設定為DispatcherPriority.Normal,和回呼,會透過委派的執行個體中傳遞NextPrimeDelegateThis call to BeginInvoke(DispatcherPriority, Delegate) takes two parameters: the priority, which is set to DispatcherPriority.Normal, and the callback, which is passed in through an instance of the delegate NextPrimeDelegate.

startStopButton.Dispatcher.BeginInvoke(
    DispatcherPriority.Normal,
    new NextPrimeDelegate(CheckNextNumber));
startStopButton.Dispatcher.BeginInvoke(DispatcherPriority.Normal, New NextPrimeDelegate(AddressOf CheckNextNumber))

備註

Dispatcher維護其優先順序的佇列,在特定執行緒的工作項目。The Dispatcher maintains a prioritized queue of work items for a specific thread.

Dispatcher會建立在執行緒變成唯一Dispatcher就會與執行緒相關聯即使Dispatcher已關閉。When a Dispatcher is created on a thread, it becomes the only Dispatcher that can be associated with the thread, even if the Dispatcher is shut down.

如果您嘗試取得CurrentDispatcher目前的執行緒並Dispatcher所關聯的執行緒,Dispatcher就建立。If you attempt to get the CurrentDispatcher for the current thread and a Dispatcher is not associated with the thread, a Dispatcher will be created. ADispatcher當您建立時,也會建立DispatcherObjectA Dispatcher is also created when you create a DispatcherObject. 如果您建立Dispatcher在背景執行緒,請務必關閉發送器在結束執行緒之前。If you create a Dispatcher on a background thread, be sure to shut down the dispatcher before exiting the thread.

如果Dispatcher關閉,無法將它重新啟動。If a Dispatcher is shut down, it cannot be restarted.

WPFWPF,則DispatcherObject只能存取由Dispatcher與其相關聯。In WPFWPF, a DispatcherObject can only be accessed by the Dispatcher it is associated with. 例如,背景執行緒無法更新的內容Button相關聯DispatcherUIUI執行緒。For example, a background thread cannot update the contents of a Button that is associated with the Dispatcher on the UIUI thread. 為了讓背景執行緒來存取Content的屬性Button,在背景執行緒必須將工作委派給Dispatcher相關聯UIUI執行緒。In order for the background thread to access the Content property of the Button, the background thread must delegate the work to the Dispatcher associated with the UIUI thread. 這是使用其中一種InvokeBeginInvokeThis is accomplished by using either Invoke or BeginInvoke. Invoke 是同步和BeginInvoke是非同步的。Invoke is synchronous and BeginInvoke is asynchronous. 作業加入佇列Dispatcher指定DispatcherPriorityThe operation is added to the queue of the Dispatcher at the specified DispatcherPriority.

如果BeginInvoke上呼叫Dispatcher,已關閉,傳回的 status 屬性DispatcherOperation設定為AbortedIf BeginInvoke is called on a Dispatcher that has shut down, the status property of the returned DispatcherOperation is set to Aborted.

所有的方法Dispatcher,但不包括DisableProcessing,會無限制執行緒。All of the methods on Dispatcher, with the exception of DisableProcessing, are free-threaded.

衍生自DispatcherObject具有執行緒相似性。Objects that derive from DispatcherObject have thread affinity.

衍生自Freezable會無限制執行緒時它們會凍結。Objects that derive from Freezable are free-threaded when they are frozen. 如需詳細資訊,請參閱 Freezable 物件概觀For more information, see Freezable Objects Overview.

屬性

CurrentDispatcher CurrentDispatcher CurrentDispatcher CurrentDispatcher

取得目前執行之執行緒的 Dispatcher 並建立新的 Dispatcher (如果尚未與執行緒產生關聯)。Gets the Dispatcher for the thread currently executing and creates a new Dispatcher if one is not already associated with the thread.

HasShutdownFinished HasShutdownFinished HasShutdownFinished HasShutdownFinished

判斷 Dispatcher 是否已完成關閉程序。Determines whether the Dispatcher has finished shutting down.

HasShutdownStarted HasShutdownStarted HasShutdownStarted HasShutdownStarted

判斷 Dispatcher 是否已關閉。Determines whether the Dispatcher is shutting down.

Hooks Hooks Hooks Hooks

取得提供 Dispatcher 額外事件資訊的攔截集合。Gets the collection of hooks that provide additional event information about the Dispatcher.

Thread Thread Thread Thread

取得與這個 Dispatcher 關聯的執行緒。Gets the thread this Dispatcher is associated with.

方法

BeginInvoke(Delegate, DispatcherPriority, Object[]) BeginInvoke(Delegate, DispatcherPriority, Object[]) BeginInvoke(Delegate, DispatcherPriority, Object[]) BeginInvoke(Delegate, DispatcherPriority, Object[])

在其中有建立 Dispatcher 的執行緒上,依據指定的優先順序,使用指定的引數非同步地執行指定的委派。Executes the specified delegate asynchronously with the specified arguments, at the specified priority, on the thread that the Dispatcher was created on.

BeginInvoke(Delegate, Object[]) BeginInvoke(Delegate, Object[]) BeginInvoke(Delegate, Object[]) BeginInvoke(Delegate, Object[])

在其中有建立 Dispatcher 的執行緒上,使用指定的引數非同步地執行指定的委派。Executes the specified delegate asynchronously with the specified arguments on the thread that the Dispatcher was created on.

BeginInvoke(DispatcherPriority, Delegate) BeginInvoke(DispatcherPriority, Delegate) BeginInvoke(DispatcherPriority, Delegate) BeginInvoke(DispatcherPriority, Delegate)

Dispatcher 關聯的執行緒上使用指定優先權以非同步方式執行指定的委派。Executes the specified delegate asynchronously at the specified priority on the thread the Dispatcher is associated with.

BeginInvoke(DispatcherPriority, Delegate, Object) BeginInvoke(DispatcherPriority, Delegate, Object) BeginInvoke(DispatcherPriority, Delegate, Object) BeginInvoke(DispatcherPriority, Delegate, Object)

Dispatcher 關聯的執行緒上使用指定優先權和指定引數以非同步方式執行指定的委派。Executes the specified delegate asynchronously at the specified priority and with the specified argument on the thread the Dispatcher is associated with.

BeginInvoke(DispatcherPriority, Delegate, Object, Object[]) BeginInvoke(DispatcherPriority, Delegate, Object, Object[]) BeginInvoke(DispatcherPriority, Delegate, Object, Object[]) BeginInvoke(DispatcherPriority, Delegate, Object, Object[])

Dispatcher 關聯的執行緒上使用指定優先權和指定引數陣列以非同步方式執行指定的委派。Executes the specified delegate asynchronously at the specified priority and with the specified array of arguments on the thread the Dispatcher is associated with.

BeginInvokeShutdown(DispatcherPriority) BeginInvokeShutdown(DispatcherPriority) BeginInvokeShutdown(DispatcherPriority) BeginInvokeShutdown(DispatcherPriority)

以非同步方式初始化 Dispatcher 的關閉程序。Initiates shutdown of the Dispatcher asynchronously.

CheckAccess() CheckAccess() CheckAccess() CheckAccess()

判斷呼叫的執行緒是否為與這個 Dispatcher 關聯的執行緒。Determines whether the calling thread is the thread associated with this Dispatcher.

DisableProcessing() DisableProcessing() DisableProcessing() DisableProcessing()

停用 Dispatcher 佇列的處理。Disables processing of the Dispatcher queue.

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

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

(Inherited from Object)
ExitAllFrames() ExitAllFrames() ExitAllFrames() ExitAllFrames()

會要求結束所有框架,包括巢狀框架。Requests that all frames exit, including nested frames.

FromThread(Thread) FromThread(Thread) FromThread(Thread) FromThread(Thread)

取得指定執行緒的 DispatcherGets the Dispatcher for the specified thread.

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)
Invoke(Action) Invoke(Action) Invoke(Action) Invoke(Action)

在與 Action 相關聯的執行緒上,同步執行指定的 DispatcherExecutes the specified Action synchronously on the thread the Dispatcher is associated with.

Invoke(Action, DispatcherPriority) Invoke(Action, DispatcherPriority) Invoke(Action, DispatcherPriority) Invoke(Action, DispatcherPriority)

在與 Action 相關聯的執行緒上使用指定優先權同步執行指定的 DispatcherExecutes the specified Action synchronously at the specified priority on the thread the Dispatcher is associated with.

Invoke(Action, DispatcherPriority, CancellationToken) Invoke(Action, DispatcherPriority, CancellationToken) Invoke(Action, DispatcherPriority, CancellationToken) Invoke(Action, DispatcherPriority, CancellationToken)

在與 Action 相關聯的執行緒上使用指定優先權同步執行指定的 DispatcherExecutes the specified Action synchronously at the specified priority on the thread the Dispatcher is associated with.

Invoke(Action, DispatcherPriority, CancellationToken, TimeSpan) Invoke(Action, DispatcherPriority, CancellationToken, TimeSpan) Invoke(Action, DispatcherPriority, CancellationToken, TimeSpan) Invoke(Action, DispatcherPriority, CancellationToken, TimeSpan)

在與 Action 相關聯的執行緒上使用指定優先權同步執行指定的 DispatcherExecutes the specified Action synchronously at the specified priority on the thread the Dispatcher is associated with.

Invoke(Delegate, DispatcherPriority, Object[]) Invoke(Delegate, DispatcherPriority, Object[]) Invoke(Delegate, DispatcherPriority, Object[]) Invoke(Delegate, DispatcherPriority, Object[])

Dispatcher 關聯的執行緒上使用指定優先權和指定引數以同步方式執行指定的委派。Executes the specified delegate at the specified priority with the specified arguments synchronously on the thread the Dispatcher is associated with.

Invoke(Delegate, Object[]) Invoke(Delegate, Object[]) Invoke(Delegate, Object[]) Invoke(Delegate, Object[])

在與 Dispatcher 相關聯的執行緒上,使用指定的引數同步地執行指定的委派。Executes the specified delegate with the specified arguments synchronously on the thread the Dispatcher is associated with.

Invoke(Delegate, TimeSpan, DispatcherPriority, Object[]) Invoke(Delegate, TimeSpan, DispatcherPriority, Object[]) Invoke(Delegate, TimeSpan, DispatcherPriority, Object[]) Invoke(Delegate, TimeSpan, DispatcherPriority, Object[])

在與 Dispatcher 有關聯的執行緒上,在指定的時間範圍內依據指定優先順序,使用指定之引數同步地執行指定的委派。Executes the specified delegate within the designated time span at the specified priority with the specified arguments synchronously on the thread the Dispatcher is associated with.

Invoke(Delegate, TimeSpan, Object[]) Invoke(Delegate, TimeSpan, Object[]) Invoke(Delegate, TimeSpan, Object[]) Invoke(Delegate, TimeSpan, Object[])

在與 Dispatcher 有關聯的執行緒上,在指定的時間範圍內依據指定優先順序,使用指定之引數同步地執行指定的委派。Executes the specified delegate within the designated time span at the specified priority with the specified arguments synchronously on the thread the Dispatcher is associated with.

Invoke(DispatcherPriority, Delegate) Invoke(DispatcherPriority, Delegate) Invoke(DispatcherPriority, Delegate) Invoke(DispatcherPriority, Delegate)

Dispatcher 關聯的執行緒上使用指定優先權以同步方式執行指定的委派。Executes the specified delegate synchronously at the specified priority on the thread on which the Dispatcher is associated with.

Invoke(DispatcherPriority, Delegate, Object) Invoke(DispatcherPriority, Delegate, Object) Invoke(DispatcherPriority, Delegate, Object) Invoke(DispatcherPriority, Delegate, Object)

Dispatcher 關聯的執行緒上使用指定優先權和指定引數以同步方式執行指定的委派。Executes the specified delegate at the specified priority with the specified argument synchronously on the thread the Dispatcher is associated with.

Invoke(DispatcherPriority, Delegate, Object, Object[]) Invoke(DispatcherPriority, Delegate, Object, Object[]) Invoke(DispatcherPriority, Delegate, Object, Object[]) Invoke(DispatcherPriority, Delegate, Object, Object[])

Dispatcher 關聯的執行緒上使用指定優先權和指定引數以同步方式執行指定的委派。Executes the specified delegate at the specified priority with the specified arguments synchronously on the thread the Dispatcher is associated with.

Invoke(DispatcherPriority, TimeSpan, Delegate) Invoke(DispatcherPriority, TimeSpan, Delegate) Invoke(DispatcherPriority, TimeSpan, Delegate) Invoke(DispatcherPriority, TimeSpan, Delegate)

在建立 Dispatcher 的執行緒上使用指定優先權和指定逾時值以同步方式執行指定的委派。Executes the specified delegate synchronously at the specified priority and with the specified time-out value on the thread the Dispatcher was created.

Invoke(DispatcherPriority, TimeSpan, Delegate, Object) Invoke(DispatcherPriority, TimeSpan, Delegate, Object) Invoke(DispatcherPriority, TimeSpan, Delegate, Object) Invoke(DispatcherPriority, TimeSpan, Delegate, Object)

Dispatcher 關聯的執行緒上使用指定優先權和指定引數以同步方式執行指定的委派。Executes the specified delegate at the specified priority with the specified argument synchronously on the thread the Dispatcher is associated with.

Invoke(DispatcherPriority, TimeSpan, Delegate, Object, Object[]) Invoke(DispatcherPriority, TimeSpan, Delegate, Object, Object[]) Invoke(DispatcherPriority, TimeSpan, Delegate, Object, Object[]) Invoke(DispatcherPriority, TimeSpan, Delegate, Object, Object[])

Dispatcher 關聯的執行緒上使用指定優先權和指定引數以同步方式執行指定的委派。Executes the specified delegate at the specified priority with the specified arguments synchronously on the thread the Dispatcher is associated with.

Invoke<TResult>(Func<TResult>) Invoke<TResult>(Func<TResult>) Invoke<TResult>(Func<TResult>) Invoke<TResult>(Func<TResult>)

在與 Func<TResult> 相關聯的執行緒上,同步執行指定的 DispatcherExecutes the specified Func<TResult> synchronously on the thread the Dispatcher is associated with.

Invoke<TResult>(Func<TResult>, DispatcherPriority) Invoke<TResult>(Func<TResult>, DispatcherPriority) Invoke<TResult>(Func<TResult>, DispatcherPriority) Invoke<TResult>(Func<TResult>, DispatcherPriority)

在與 Func<TResult> 相關聯的執行緒上使用指定優先權同步執行指定的 DispatcherExecutes the specified Func<TResult> synchronously at the specified priority on the thread the Dispatcher is associated with.

Invoke<TResult>(Func<TResult>, DispatcherPriority, CancellationToken) Invoke<TResult>(Func<TResult>, DispatcherPriority, CancellationToken) Invoke<TResult>(Func<TResult>, DispatcherPriority, CancellationToken) Invoke<TResult>(Func<TResult>, DispatcherPriority, CancellationToken)

在與 Func<TResult> 相關聯的執行緒上使用指定優先權同步執行指定的 DispatcherExecutes the specified Func<TResult> synchronously at the specified priority on the thread the Dispatcher is associated with.

Invoke<TResult>(Func<TResult>, DispatcherPriority, CancellationToken, TimeSpan) Invoke<TResult>(Func<TResult>, DispatcherPriority, CancellationToken, TimeSpan) Invoke<TResult>(Func<TResult>, DispatcherPriority, CancellationToken, TimeSpan) Invoke<TResult>(Func<TResult>, DispatcherPriority, CancellationToken, TimeSpan)

在與 Func<TResult> 相關聯的執行緒上使用指定優先權同步執行指定的 DispatcherExecutes the specified Func<TResult> synchronously at the specified priority on the thread the Dispatcher is associated with.

InvokeAsync(Action) InvokeAsync(Action) InvokeAsync(Action) InvokeAsync(Action)

在與 Action 相關聯的執行緒上,以非同步方式執行指定的 DispatcherExecutes the specified Action asynchronously on the thread the Dispatcher is associated with.

InvokeAsync(Action, DispatcherPriority) InvokeAsync(Action, DispatcherPriority) InvokeAsync(Action, DispatcherPriority) InvokeAsync(Action, DispatcherPriority)

在與 Action 相關聯的執行緒上使用指定優先權以非同步方式執行指定的 DispatcherExecutes the specified Action asynchronously at the specified priority on the thread the Dispatcher is associated with.

InvokeAsync(Action, DispatcherPriority, CancellationToken) InvokeAsync(Action, DispatcherPriority, CancellationToken) InvokeAsync(Action, DispatcherPriority, CancellationToken) InvokeAsync(Action, DispatcherPriority, CancellationToken)

在與 Action 相關聯的執行緒上使用指定優先權以非同步方式執行指定的 DispatcherExecutes the specified Action asynchronously at the specified priority on the thread the Dispatcher is associated with.

InvokeAsync<TResult>(Func<TResult>) InvokeAsync<TResult>(Func<TResult>) InvokeAsync<TResult>(Func<TResult>) InvokeAsync<TResult>(Func<TResult>)

在與 Func<TResult> 相關聯的執行緒上,以非同步方式執行指定的 DispatcherExecutes the specified Func<TResult> asynchronously on the thread the Dispatcher is associated with.

InvokeAsync<TResult>(Func<TResult>, DispatcherPriority) InvokeAsync<TResult>(Func<TResult>, DispatcherPriority) InvokeAsync<TResult>(Func<TResult>, DispatcherPriority) InvokeAsync<TResult>(Func<TResult>, DispatcherPriority)

在與 Func<TResult> 相關聯的執行緒上使用指定優先權以非同步方式執行指定的 DispatcherExecutes the specified Func<TResult> asynchronously at the specified priority on the thread the Dispatcher is associated with.

InvokeAsync<TResult>(Func<TResult>, DispatcherPriority, CancellationToken) InvokeAsync<TResult>(Func<TResult>, DispatcherPriority, CancellationToken) InvokeAsync<TResult>(Func<TResult>, DispatcherPriority, CancellationToken) InvokeAsync<TResult>(Func<TResult>, DispatcherPriority, CancellationToken)

在與 Func<TResult> 相關聯的執行緒上使用指定優先權以非同步方式執行指定的 DispatcherExecutes the specified Func<TResult> asynchronously at the specified priority on the thread the Dispatcher is associated with.

InvokeShutdown() InvokeShutdown() InvokeShutdown() InvokeShutdown()

以同步方式初始化 Dispatcher 的關閉程序。Initiates the shutdown process of the Dispatcher synchronously.

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

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

(Inherited from Object)
PushFrame(DispatcherFrame) PushFrame(DispatcherFrame) PushFrame(DispatcherFrame) PushFrame(DispatcherFrame)

會進入執行迴圈。Enters an execute loop.

Run() Run() Run() Run()

推入 Dispatcher 事件佇列上的主執行框架。Pushes the main execution frame on the event queue of the Dispatcher.

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

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

(Inherited from Object)
ValidatePriority(DispatcherPriority, String) ValidatePriority(DispatcherPriority, String) ValidatePriority(DispatcherPriority, String) ValidatePriority(DispatcherPriority, String)

判斷指定的 DispatcherPriority 是否為有效的優先權。Determines whether the specified DispatcherPriority is a valid priority.

VerifyAccess() VerifyAccess() VerifyAccess() VerifyAccess()

判斷呼叫的執行是否可以存取這個 DispatcherDetermines whether the calling thread has access to this Dispatcher.

Yield() Yield() Yield() Yield()

建立 awaitable 物件,這個物件會以非同步方式讓出控制權給目前的發送器,並提供機會給發送器以處理其他事件。Creates an awaitable object that asynchronously yields control back to the current dispatcher and provides an opportunity for the dispatcher to process other events.

Yield(DispatcherPriority) Yield(DispatcherPriority) Yield(DispatcherPriority) Yield(DispatcherPriority)

建立 awaitable 物件,這個物件會以非同步方式讓出控制權給目前的發送器,並提供機會給發送器以處理其他事件。Creates an awaitable object that asynchronously yields control back to the current dispatcher and provides an opportunity for the dispatcher to process other events. 在控制權回到等候此方法之結果的程式碼時進行的工作會以指定的優先權來排定。The work that occurs when control returns to the code awaiting the result of this method is scheduled with the specified priority.

事件

ShutdownFinished ShutdownFinished ShutdownFinished ShutdownFinished

發生於 Dispatcher 完成關閉時。Occurs when the Dispatcher finishes shutting down.

ShutdownStarted ShutdownStarted ShutdownStarted ShutdownStarted

發生於 Dispatcher 開始關閉時。Occurs when the Dispatcher begins to shut down.

UnhandledException UnhandledException UnhandledException UnhandledException

發生於當擲回執行緒例外狀況且透過 InvokeBeginInvoke 執行委派期間無法攔截時。Occurs when a thread exception is thrown and uncaught during execution of a delegate by way of Invoke or BeginInvoke.

UnhandledExceptionFilter UnhandledExceptionFilter UnhandledExceptionFilter UnhandledExceptionFilter

發生於在篩選階段擲回執行緒例外狀況且透過 InvokeBeginInvoke 執行委派期間無法攔截時。Occurs when a thread exception is thrown and uncaught during execution of a delegate by way of Invoke or BeginInvoke when in the filter stage.

Extension Methods

BeginInvoke(Dispatcher, Action) BeginInvoke(Dispatcher, Action) BeginInvoke(Dispatcher, Action) BeginInvoke(Dispatcher, Action)

在特定 Dispatcher 所建立的執行緒上,以非同步的方式,根據一般優先權執行指定的委派。Executes the specified delegate asynchronously with normal priority on the thread that the specified Dispatcher was created on.

BeginInvoke(Dispatcher, Action, DispatcherPriority) BeginInvoke(Dispatcher, Action, DispatcherPriority) BeginInvoke(Dispatcher, Action, DispatcherPriority) BeginInvoke(Dispatcher, Action, DispatcherPriority)

在特定 Dispatcher 所建立的執行緒上,以非同步的方式,根據特定優先權,執行指定的委派。Executes the specified delegate asynchronously with the specified priority on the thread that the specified Dispatcher was created on.

Invoke(Dispatcher, Action) Invoke(Dispatcher, Action) Invoke(Dispatcher, Action) Invoke(Dispatcher, Action)

在特定 Dispatcher 所建立的執行緒上,以同步方式,根據一般優先權,執行指定的委派。Executes the specified delegate synchronously with normal priority on the thread that the specified Dispatcher was created on.

Invoke(Dispatcher, Action, TimeSpan) Invoke(Dispatcher, Action, TimeSpan) Invoke(Dispatcher, Action, TimeSpan) Invoke(Dispatcher, Action, TimeSpan)

在特定 Dispatcher 所建立的執行緒上,以同步方式,執行指定的委派,並在指定逾時期間後停止執行。Executes the specified delegate synchronously on the thread that the specified Dispatcher was created on, and stops execution after the specified time-out period.

Invoke(Dispatcher, Action, TimeSpan, DispatcherPriority) Invoke(Dispatcher, Action, TimeSpan, DispatcherPriority) Invoke(Dispatcher, Action, TimeSpan, DispatcherPriority) Invoke(Dispatcher, Action, TimeSpan, DispatcherPriority)

在特定 Dispatcher 所建立的執行緒上,以同步方式,根據特定優先權,執行指定的委派,並於指定逾時期間後停止執行。Executes the specified delegate synchronously with the specified priority on the thread that the specified Dispatcher was created on, and stops execution after the specified time-out period.

Invoke(Dispatcher, Action, DispatcherPriority) Invoke(Dispatcher, Action, DispatcherPriority) Invoke(Dispatcher, Action, DispatcherPriority) Invoke(Dispatcher, Action, DispatcherPriority)

在特定 Dispatcher 所建立的執行緒上,以同步方式,根據特定優先權,執行指定的委派。Executes the specified delegate synchronously with the specified priority on the thread that the specified Dispatcher was created on.

適用於

另請參閱