Chapter 15. C# events

I recommend that you read and understand Chapter 14 before proceeding.

Any modern programming language has an efficient event model, and C# is no exception. The concepts in C#'s event model are quite similar to Java 2's event delegation model: – we still have the event source, the event consumer, and the event object. However, unlike Java 2's event delegation model, C#'s model uses an event object which is a special type of C# delegate.

I will start by examining the generic event model, then zoom in to C# specifics. If you are familiar with events, jump to section 15.2.

Get From Java to C#: A Developer's Guide 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.