If I do this line:
EventHandler foobar = new EventHandler(fooMethod);
fooMethod must be a method with the following signature:
public void fooMethod(object obj, EventArgs args){}
It makes sense to me. However, this code works very well:
EventHandler foo = delegate { };
Like this? I would think that I need to do this:
EventHandler foo = delegate(object obj, EventArgs arg) { };
The above line works btw. I'm just confused about how I can assign an "empty" EventHandler delegate.
Thanks to everyone who can light me up!
source
share