Rationale behind EventArgs class

.net, c#, events

Solution

The upsides with the EventArgs class are (as I see it) mainly these two:

- You can add members to the EventArgs class withouth altering the signature of the event

- You disconnect the information passed to the event handler from the object instance

It may even be that the information contained in the EventArgs is not exposed by the object raising the event.

Sure, in some cases it may seem like overkill, but I think that the power of sameness is a good thing here; if you know how one event works, you know how other events work as well.

Problem

I'm learning events in C# and understand that the `EventArgs` class carries data about the event. But I am having difficulties understanding why `EventArgs` is necessary. For instance, in this MSDN example, couldn't the `WakeMeUp` class read all of the necessary data (`snoozePressed`, `nrings`) from the fields of `AlarmClock`? If it can set them, why couldn't it also get them?

Original source