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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access