I recall reading, on multiple occasions and in multiple locations, that when firing the typical event:
protected virtual OnSomethingHappened()
{
this.SomethingHappened(this, EventArgs.Empty);
}
e should be EventArgs.Empty if there are no interesting event args, not null.
I've followed the guidance in my code, but I realized that I'm not clear on why that's the preferred technique.
- Why does the stated contract prefer EventArgs.Empty over null?
- What sort of situations in my own code would justify a similar design decision? When should I consider creating some static "Nothing interesting here" property instead of using null to indicate the absence of something interesting?
- Has the addition of nullable value types impacted these decisions?