xtd 0.2.0
Loading...
Searching...
No Matches

◆ invoke() [6/6]

virtual std::optional< object_ref > xtd::isynchronize_invoke::invoke ( delegate< void(std::vector< std::any >)>  method,
std::any  arg 
)
virtual

Synchronously executes the delegate on the thread that created this object and marshals the call to the creating thread.

Parameters
methodA xtd::delegate that contains a method to call, in the context of the thread for the control.
argAn xtd::object that represents the argument to pass to the given method.
Returns
An xtd::object that represents the return value from the delegate being invoked, or null if the delegate has no return value.
Remarks
Unlike xtd::isynchronize_invoke::begin_invoke, this method operates synchronously, that is, it waits until the process completes before returning. Exceptions raised during the call are propagated back to the caller.
Use this method when calling a method from a different thread to marshal the call to the proper thread.

Implements xtd::isynchronize_invoke.