I'm trying to call Invoke
with a array as parameter.
The problem is that Invoke
uses the params
- if my array is 3 elements long, Invoke
tries to call a method with 3 parameters instead of calling the method with one ARRAY parameter:
private void something(Control[] dataDropControls) {
// ...
this.Invoke(new Action<Control[]>(initControls), dataDropControls);
}
private void initControls(Control[] controls) {
// ...
}
(This question does not answer my question, because the parameter array is build in the calling function. Im my case, the function gets the already built array.)
Q: How can I call Invoke
so that it can call the method with one array parameter?