What Are Delegates?

Now you know how to consume and produce events, and we'll see many examples of these throughout this book. But you may be asking yourself, “What is the big deal about delegates?”

For the most part, after reading the earlier sections in this chapter you know everything you need to know. However, there is an important chunk of information we still need to cover. Delegates are actually classes. For years we have had function pointers—also called procedural types—but these implementations were not classes. They were simple instances of single function pointers. The result was that every programmer had to write code to determine whether the function pointer was assigned to something, and if you wanted to stored multiple values ...

Get Visual Basic® .NET Power Coding 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.