I have a pretty basic event:
public event EventHandler OnAborted;
All I need to do is call this event, I don't even need to provide any arguments, so it's nothing fancy. I'm confused with the correct usage of the EventArgs
argument.
I can use:
if (OnAborted != null)
OnAborted(this, EventArgs.Empty);
Or I can even use:
if (OnAborted != null)
OnAborted(this, new EventArgs());
In both cases, EventArgs
seems to be pretty useless, I can't even provide any arguments (not that I need to, but that's not the point).
What is the proper usage of EventArgs? Should I create a custom class that inherits EventArgs
?