Possible Duplicate:
EventHandler type with no event args
I am creating event handlers and the corresponding event args (:EventArgs) thorough my project. But I am wondering if I need this EventArgs object. As I often have in this EventArgs on property, corresponding to this specific EventHandler.
Why should I need an EventArgs object where I could directly used the value?
I understand the value of using a specific object container like this sometimes. But most of the time I just need to pass one or two objects. Example: Why PropertyChangedEventHandler bothers itself using an EventArgs where a String would be enough? Does that not bring overhead?
I guess it’s a .NET convention to make event handlers uniform by accepting two parameters: the source of the event (
sender) and the event args wrapped in a genericEventArgsobject.No, because you pass a reference anyway, so no data actually gets moved around.