Bewerken

Delen via


DispatcherExtensions.Invoke Method

Definition

Executes the specified delegate synchronously on the thread that the specified Dispatcher was created on.

Overloads

Invoke(Dispatcher, Action)

Executes the specified delegate synchronously with normal priority on the thread that the specified Dispatcher was created on.

Invoke(Dispatcher, Action, TimeSpan)

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, DispatcherPriority)

Executes the specified delegate synchronously with the specified priority on the thread that the specified Dispatcher was created on.

Invoke(Dispatcher, Action, TimeSpan, DispatcherPriority)

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)

Executes the specified delegate synchronously with normal priority on the thread that the specified Dispatcher was created on.

public:
[System::Runtime::CompilerServices::Extension]
 static void Invoke(System::Windows::Threading::Dispatcher ^ dispatcher, Action ^ action);
public static void Invoke (this System.Windows.Threading.Dispatcher dispatcher, Action action);
[System.ComponentModel.Browsable(false)]
public static void Invoke (this System.Windows.Threading.Dispatcher dispatcher, Action action);
static member Invoke : System.Windows.Threading.Dispatcher * Action -> unit
[<System.ComponentModel.Browsable(false)>]
static member Invoke : System.Windows.Threading.Dispatcher * Action -> unit
<Extension()>
Public Sub Invoke (dispatcher As Dispatcher, action As Action)

Parameters

dispatcher
Dispatcher

The dispatcher that executes the delegate.

action
Action

The delegate to execute, which takes no arguments and does not return a value.

Attributes

Exceptions

action is null.

Applies to

Invoke(Dispatcher, Action, TimeSpan)

Executes the specified delegate synchronously on the thread that the specified Dispatcher was created on, and stops execution after the specified time-out period.

public:
[System::Runtime::CompilerServices::Extension]
 static void Invoke(System::Windows::Threading::Dispatcher ^ dispatcher, Action ^ action, TimeSpan timeout);
public static void Invoke (this System.Windows.Threading.Dispatcher dispatcher, Action action, TimeSpan timeout);
[System.ComponentModel.Browsable(false)]
public static void Invoke (this System.Windows.Threading.Dispatcher dispatcher, Action action, TimeSpan timeout);
static member Invoke : System.Windows.Threading.Dispatcher * Action * TimeSpan -> unit
[<System.ComponentModel.Browsable(false)>]
static member Invoke : System.Windows.Threading.Dispatcher * Action * TimeSpan -> unit
<Extension()>
Public Sub Invoke (dispatcher As Dispatcher, action As Action, timeout As TimeSpan)

Parameters

dispatcher
Dispatcher

The dispatcher that executes the delegate.

action
Action

The delegate to execute, which takes no arguments and does not return a value.

timeout
TimeSpan

The maximum time to wait for the operation to finish.

Attributes

Exceptions

action is null.

priority is equal to Inactive.

Applies to

Invoke(Dispatcher, Action, DispatcherPriority)

Executes the specified delegate synchronously with the specified priority on the thread that the specified Dispatcher was created on.

public:
[System::Runtime::CompilerServices::Extension]
 static void Invoke(System::Windows::Threading::Dispatcher ^ dispatcher, Action ^ action, System::Windows::Threading::DispatcherPriority priority);
public static void Invoke (this System.Windows.Threading.Dispatcher dispatcher, Action action, System.Windows.Threading.DispatcherPriority priority);
[System.ComponentModel.Browsable(false)]
public static void Invoke (this System.Windows.Threading.Dispatcher dispatcher, Action action, System.Windows.Threading.DispatcherPriority priority);
static member Invoke : System.Windows.Threading.Dispatcher * Action * System.Windows.Threading.DispatcherPriority -> unit
[<System.ComponentModel.Browsable(false)>]
static member Invoke : System.Windows.Threading.Dispatcher * Action * System.Windows.Threading.DispatcherPriority -> unit
<Extension()>
Public Sub Invoke (dispatcher As Dispatcher, action As Action, priority As DispatcherPriority)

Parameters

dispatcher
Dispatcher

The dispatcher that executes the delegate.

action
Action

The delegate to execute, which takes no arguments and does not return a value.

priority
DispatcherPriority

The execution priority of the delegate relative to other pending operations in the Dispatcher event queue.

Attributes

Exceptions

action is null.

priority is equal to Inactive.

Applies to

Invoke(Dispatcher, Action, TimeSpan, DispatcherPriority)

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.

public:
[System::Runtime::CompilerServices::Extension]
 static void Invoke(System::Windows::Threading::Dispatcher ^ dispatcher, Action ^ action, TimeSpan timeout, System::Windows::Threading::DispatcherPriority priority);
public static void Invoke (this System.Windows.Threading.Dispatcher dispatcher, Action action, TimeSpan timeout, System.Windows.Threading.DispatcherPriority priority);
[System.ComponentModel.Browsable(false)]
public static void Invoke (this System.Windows.Threading.Dispatcher dispatcher, Action action, TimeSpan timeout, System.Windows.Threading.DispatcherPriority priority);
static member Invoke : System.Windows.Threading.Dispatcher * Action * TimeSpan * System.Windows.Threading.DispatcherPriority -> unit
[<System.ComponentModel.Browsable(false)>]
static member Invoke : System.Windows.Threading.Dispatcher * Action * TimeSpan * System.Windows.Threading.DispatcherPriority -> unit
<Extension()>
Public Sub Invoke (dispatcher As Dispatcher, action As Action, timeout As TimeSpan, priority As DispatcherPriority)

Parameters

dispatcher
Dispatcher

The dispatcher that executes the delegate.

action
Action

The delegate to execute, which takes no arguments and does not return a value.

timeout
TimeSpan

The maximum time to wait for the operation to finish.

priority
DispatcherPriority

The execution priority of the delegate relative to other pending operations in the Dispatcher event queue.

Attributes

Exceptions

action is null.

priority is equal to Inactive.

Applies to