Chapter 10. Delegates, Events, and Anonymous Methods
Delegates are special types that encapsulate a method, similar to function pointers found in other programming languages. Delegates have a number of uses in C#, but you are most likely to encounter a special type of delegate—the event. Events make notifying interested parties simple and flexible, and I'll explain the convention for their use later in the chapter.
I'll also explain the
Action types that let you use delegates in a more convenient form and that are used extensively in some of the latest C# language features, such as parallel programming.
We'll finish up this chapter with a look at anonymous methods and lambda expressions, two C# features that let us implement delegates without ...