C H A P T E R 13
Delegates
- What Is a Delegate?
- An Overview of Delegates
- Declaring the Delegate Type
- Creating the Delegate Object
- Assigning Delegates
- Combining Delegates
- Adding Methods to Delegates
- Removing Methods from a Delegate
- Invoking a Delegate
- Delegate Example
- Invoking Delegates with Return Values
- Invoking Delegates with Reference Parameters
- Anonymous Methods
- Lambda Expressions
What Is a Delegate?
You can think of a delegate as an object that holds one or more methods. Normally, of course, you wouldn’t think of “executing” an object, but a delegate is different from a typical object. You can execute a delegate, and when you do so, it executes the method or methods that it “holds.”
In this chapter I'll explain the syntax and semantics ...
Get Illustrated C# 2012 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.