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

◆ invoke() [2/3]

virtual std::optional< object_ref > xtd::isynchronize_invoke::invoke ( delegate< void(std::vector< std::any >)>  method,
const std::vector< std::any > &  args 
)
pure 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.
argsAn array of type xtd::object that represents the arguments to pass to the given method. This can be empty if no arguments are needed.
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.

Implemented in xtd::forms::control, and xtd::forms::control.