O'Reilly logo

.NET Common Language Runtime Unleashed by Kevin Burton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Asynchronous delegates

From Figure 14.1, you can see that every delegate not only derives from MulticastDelegate, but also that several methods in addition to the Delegate and MulticastDelegate methods are available. When the compiler encounters the delegate keyword, it creates a class that extends MulticastDelegate and adds the following methods:

  • BeginInvoke

  • EndInvoke

  • Invoke

If you try to call the Invoke method directly from a delegate, you will receive the compile time error Invoke cannot be called directly on a delegate. Because each delegate can have a different signature and it is desirable to have a type safe interface, the compiler does some things automatically for you. The first thing that the compiler does is discover the number of arguments, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required