Events

An event is a C# language element that indicates a certain, user-defined, occurrence. It is a mechanism that initiates a dynamic form of communication between program elements. Rather than a procedural flow of control from one part of a program to another, events are the way to establish connection between program occurrences and resulting actions during runtime processing.

Events are used to notify interested listeners of various occurrences during a program's lifetime. They're used in C# components to provide a callback functionality in programs. This produces a level of efficiency not available in many languages where switch statements and object-hierarchy searching are the norm for invoking dynamic functionality.

Events derive their ...

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