Events

An event is a mechanism a class can use to provide notifications to its client applications.

Graphical user interfaces provide familiar examples of this. Consider an action such as a user clicking a button control. This action generates an event. The respective clients are then notified of the event so that the corresponding processing can take place. The client in this case can be a parent form that receives notifications from the button control.

For instance, a button control can notify its parent form that it is clicked. Similarly, a list control can notify the other controls in the form whenever a selection change happens in the list control.

However, the concept of events is not restricted merely to GUI programming. Events can now ...

Get Special Edition Using C# 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.