Asynchronous Delegates

One of the basic building blocks in .NET is the delegate. Delegates are often described as type-safe function pointers. They are function pointers because they enable you to store a reference that "points" to a class method. They are type-safe because every delegate is defined with a fixed method signature. For example, you might create a delegate variable that can point to any method that takes two string parameters and returns an integer value. This is the delegate signature. You can’t use this delegate to store a reference to a method with a different signature (for example, one that takes two string parameters and has no return value).

The two core delegate classes are as follows:

  • System.Delegate

    The base delegate type, ...

Get Microsoft® .NET Distributed Applications: Integrating XML Web Services and .NET Remoting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.