When designing frameworks, consistency is all important to make people feel at home with new APIs quickly. For educational purposes, we’ve approached the concept of events from their essential property: Events are nothing but delegates in disguise. In doing so, we chose simple delegate types for our examples, as follows:
In practice, it’s more common to follow a certain pattern for events that makes their handlers have a consistent shape. We’ve already seen such a case in passing, when showing off an event handler for a button control’s
Click event in Windows Forms:
From this signature, you can infer the type of the ...