AsyncResult.AsyncDelegate Property
Gets the delegate object on which the asynchronous call was invoked.
Assembly: mscorlib (in mscorlib.dll)
The AsyncDelegate property can be cast to the actual class of the user-defined delegate.
For example, if the delegate that was used to make the asynchronous call is of type MyDelegate, the delegate that is returned by this property must be cast to MyDelegate. The callback method can then call the delegate's EndInvoke method with the correct signature, in order to obtain the results of the asynchronous method call.
The following code example demonstrates how to use the AsyncDelegate property to get the delegate that was used to make the asynchronous call, in order to call EndInvoke. The example casts the IAsyncResult, which is the only parameter of the callback method, to an AsyncResult object.
The example consists of two classes, the class that contains the method which is called asynchronously, and the class that contains the Main method that makes the call.
For more information on the way this callback example works, and more examples of calling methods asynchronously by using delegates, see Calling Synchronous Methods Asynchronously.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.