I would like to know about the Invoke(delegate) method. I do not understand why I do not need to specify arguments. What if I need them supply..Hopefully below you better understand what I mean. Thank you
EventHandler a = new EventHandler(this.A);
Invoke(a); //where doest it take the arguments from?
a(); //does not work, missing arguments
Because Invoke is meant to be used on Windows Forms, and the pattern for events used here is well specified, the Invoke method can make an educated guess. In fact, it is documented on MSDN exactly what it does, if you try to invoke an EventHandler without parameters using Invoke:
You can, and should, use the overload of Invoke that allows you to specifiy the parameteres of your delegate, in order to make it more explicit what is going on. Also, calling Invoke without the parameters array will only work for delegates of type EventHandler (or, of course, delegates that does not take any parameters in the first place).