Export (0) Print
Expand All

ISynchronizeInvoke Interface

Provides a way to synchronously or asynchronously execute a delegate.

Namespace:  System.ComponentModel
Assembly:  System (in System.dll)

public interface ISynchronizeInvoke

The ISynchronizeInvoke type exposes the following members.

  NameDescription
Public propertyInvokeRequiredGets a value indicating whether the caller must call Invoke when calling an object that implements this interface.
Top

  NameDescription
Public methodBeginInvokeAsynchronously executes the delegate on the thread that created this object.
Public methodEndInvokeWaits until the process started by calling BeginInvoke completes, and then returns the value generated by the process.
Public methodInvokeSynchronously executes the delegate on the thread that created this object and marshals the call to the creating thread.
Top

The ISynchronizeInvoke interface provides synchronous and asynchronous communication between objects about the occurrence of an event. Objects that implement this interface can receive notification that an event has occurred, and they can respond to queries about the event. In this way, clients can ensure that one request has been processed before they submit a subsequent request that depends on completion of the first.

The ISynchronizeInvoke class provides two ways to invoke a process:

  1. Asynchronously, by using the BeginInvoke method. BeginInvoke starts a process and then returns immediately. Use EndInvoke to wait until the process started by BeginInvoke completes.

  2. Synchronously, by using the Invoke method. Invoke starts a process, waits until it completes, and then returns. Use Invoke when the control's main thread is different from the calling thread to marshal the call to the proper thread.

NoteNote

The HostProtectionAttribute attribute applied to this class has the following Resources property value: Synchronization | ExternalThreading. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft