Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

interface System.​ComponentModel.​ISynchronizeInvoke

Assembly: System.ComponentModel.Primitives

Provides a way to synchronously or asynchronously execute a delegate.

Properties

bool
InvokeRequired
Gets a value indicating whether the caller must call <see cref="M:System.ComponentModel.ISynchronizeInvoke.Invoke(System.Delegate,System.Object[])" /> when calling an object that implements this interface.

Methods

BeginInvoke​(delegate method, object[] args)
Asynchronously executes the delegate on the thread that created this object.
Returns An <see cref="T:System.IAsyncResult" /> interface that represents the asynchronous operation started by calling this method.
method A <see cref="T:System.Delegate" /> to a method that takes parameters of the same number and type that are contained in <paramref name="args" /> .
args An array of type <see cref="T:System.Object" /> to pass as arguments to the given method. This can be <see langword="null" /> if no arguments are needed.
object
EndInvoke​(IAsyncResult result)
Waits until the process started by calling <see cref="M:System.ComponentModel.ISynchronizeInvoke.BeginInvoke(System.Delegate,System.Object[])" /> completes, and then returns the value generated by the process.
Returns An <see cref="T:System.Object" /> that represents the return value generated by the asynchronous operation.
result An <see cref="T:System.IAsyncResult" /> interface that represents the asynchronous operation started by calling <see cref="M:System.ComponentModel.ISynchronizeInvoke.BeginInvoke(System.Delegate,System.Object[])" /> .
object
Invoke​(delegate method, object[] args)
Synchronously executes the delegate on the thread that created this object and marshals the call to the creating thread.
Returns An <see cref="T:System.Object" /> that represents the return value from the delegate being invoked, or <see langword="null" /> if the delegate has no return value.
method A <see cref="T:System.Delegate" /> that contains a method to call, in the context of the thread for the control.
args An array of type <see cref="T:System.Object" /> that represents the arguments to pass to the given method. This can be <see langword="null" /> if no arguments are needed.