When creating an event, it is standard to send an EventArgs
object as the second argument. However, often times the event may only need to send one piece of data, such as a string or int. As far as I know, you cannot really do anything with the base EventArgs
class.
So is it really necessary to create an entire new class with one field just to send a simple string/int with an event?
Example
public delegate void JoinButtonEvent(object sender, string buttonId);
vs
public delegate void JoinButtonEvent(object sender, JoinButtonEventArgs e);
Where JoinButtonEventArgs
is a class with field called buttonId
.