Skip to Content
Essential C# 3.0: For .NET Framework 3.5
book

Essential C# 3.0: For .NET Framework 3.5

by Mark Michaelis
August 2008
Intermediate to advanced content levelIntermediate to advanced
880 pages
18h 35m
English
Addison-Wesley Professional
Content preview from Essential C# 3.0: For .NET Framework 3.5

13. Events

IN THE PRECEDING CHAPTER, you saw how to store a single method inside an instance of a delegate type and invoke that method via the delegate. Delegates comprise the building blocks of a larger pattern called publish-subscribe. The use of delegates and their support for publish-subscribe patterns is the focus of this chapter. Virtually everything described within this chapter is possible to do using delegates alone. However, the event constructs that this chapter focuses on provide important encapsulation, making the publish-and-subscribe pattern easier to implement and less error-prone.

In the preceding chapter, all delegates were for a single callback (a multiplicity of one). However, a single delegate variable can reference a series ...

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.
Start your free trial

You might also like

C# 4.0 Unleashed

C# 4.0 Unleashed

Bart De Smet

Publisher Resources

ISBN: 9780321580559Purchase book