Summary

Delegates and events are crucial pieces that make the .NET Framework tick. Having a solid understanding of both concepts will take you a long way in discovering framework functionality and designing your own extensible APIs. This chapter looked at the concept of delegates, which form the basis for events covered in the next chapter.

Although the concept of functional programming lies, at least conceptually, at the heart of delegates, they can simply be seen as a strongly typed contract describing a single operation. One party acts as a consumer, invoking the delegate to reach out to the functionality provided from the outside. The other party hands out a piece of code that adheres to the delegate contract (its signature, if you will) ...

Get C# 4.0 Unleashed 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.