Posters at Are EventArg classes needed now that we have generics and Does .NET have a built-in EventArgs<T>? are advising against a generic EventArgs, at least that's the feeling I get.
Is it justified to use it when all I need is one of the build-in types? In my specific case I'm reading from a stream over TCP, and when data is received, subscribers are notified.
public event EventHandler<EventArgs<string>> data_received = delegate { };
...
while (!reader.EndOfStream)
{
if ((data = reader.ReadLine()) != "")
{
this.data_received(this, new EventArgs<string>(data));
}
}
Or perhaps an event isn't the best way to pass data to subscribers?