DispatcherExtensions::Invoke Method (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.

Namespace:   System.Windows.Threading
Assembly:  System.Windows.Presentation (in System.Windows.Presentation.dll)

public:
[ExtensionAttribute]
[BrowsableAttribute(false)]
static void Invoke(
	Dispatcher^ dispatcher,
	Action^ action,
	TimeSpan timeout
)

Parameters

dispatcher
Type: System.Windows.Threading::Dispatcher^

The dispatcher that executes the delegate.

action
Type: System::Action^

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

timeout
Type: System::TimeSpan

The maximum time to wait for the operation to finish.

Exception Condition
ArgumentNullException

action is null.

ArgumentException

priority is equal to Inactive.

InvalidEnumArgumentException

priority is not a valid DispatcherPriority.

.NET Framework
Available since 3.5
Return to top
Show: