DispatcherExtensions.Invoke 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在创建指定的线程上同步执行指定的 Dispatcher 委托。
重载
| 名称 | 说明 |
|---|---|
| Invoke(Dispatcher, Action) |
在创建指定的线程上以正常优先级同步执行指定的 Dispatcher 委托。 |
| Invoke(Dispatcher, Action, TimeSpan) |
在创建指定的线程上同步执行指定的 Dispatcher 委托,并在指定的超时时间段后停止执行。 |
| Invoke(Dispatcher, Action, DispatcherPriority) |
在创建指定的线程上,使用指定的优先级同步执行指定的 Dispatcher 委托。 |
| Invoke(Dispatcher, Action, TimeSpan, DispatcherPriority) |
使用指定的线程上的指定优先级同步执行指定的 Dispatcher 委托,并在指定的超时时间段后停止执行。 |
Invoke(Dispatcher, Action)
在创建指定的线程上以正常优先级同步执行指定的 Dispatcher 委托。
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)
参数
- dispatcher
- Dispatcher
执行委托的调度程序。
- action
- Action
要执行的委托,该委托不采用任何参数,并且不返回值。
- 特性
例外
action 是 null。
适用于
Invoke(Dispatcher, Action, TimeSpan)
在创建指定的线程上同步执行指定的 Dispatcher 委托,并在指定的超时时间段后停止执行。
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)
参数
- dispatcher
- Dispatcher
执行委托的调度程序。
- action
- Action
要执行的委托,该委托不采用任何参数,并且不返回值。
- timeout
- TimeSpan
等待操作完成的最长时间。
- 特性
例外
action 是 null。
priority 等于 Inactive.
priority 不是有效的 DispatcherPriority。
适用于
Invoke(Dispatcher, Action, DispatcherPriority)
在创建指定的线程上,使用指定的优先级同步执行指定的 Dispatcher 委托。
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)
参数
- dispatcher
- Dispatcher
执行委托的调度程序。
- action
- Action
要执行的委托,该委托不采用任何参数,并且不返回值。
- priority
- DispatcherPriority
委托相对于事件队列中的其他 Dispatcher 挂起操作的执行优先级。
- 特性
例外
action 是 null。
priority 等于 Inactive.
priority 不是有效的 DispatcherPriority。
适用于
Invoke(Dispatcher, Action, TimeSpan, DispatcherPriority)
使用指定的线程上的指定优先级同步执行指定的 Dispatcher 委托,并在指定的超时时间段后停止执行。
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)
参数
- dispatcher
- Dispatcher
执行委托的调度程序。
- action
- Action
要执行的委托,该委托不采用任何参数,并且不返回值。
- timeout
- TimeSpan
等待操作完成的最长时间。
- priority
- DispatcherPriority
委托相对于事件队列中的其他 Dispatcher 挂起操作的执行优先级。
- 特性
例外
action 是 null。
priority 等于 Inactive.
priority 不是有效的 DispatcherPriority。