Chapter 11. Events
In this chapter:
Designing a Type That Exposes an Event
How the Compiler Implements an Event
Designing a Type That Listens for an Event
Explicitly Implementing an Event
In this chapter, I’ll talk about the last kind of member a type
can define: events. A type that defines an event member allows the
type (or instances of the type) to notify other objects that something
special has happened. For example, the Button class
offers an event called Click. When a
Button object is clicked, one or more objects in an application may want to receive notification about this event in order to perform some action. Events are type members that allow this interaction. Specifically, defining an event member means that a type is offering the following ...
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