Summary

This chapter covered delegates and events. It explained how delegates provide the infrastructure for events. There was a section showing how to define a delegate. It showed how to define delegate method handlers and how to connect them to a delegate. This led to the purpose of delegates and a demonstration of how to invoke methods through delegates. The multi-cast delegate section showed how to invoke multiple delegates at the same time through a single delegate invocation. Delegates can be compared with the equal (==) and not equal (!=) operators.

The section covering events showed how to define event handlers using delegates. Then there was a section on how subscribers can register for events. Once registered, the subscriber is notified ...

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.