Suppose I want to have a method that passes the BeginInvoke method of an object as a parameter. How would I do that? The call looks like this:
MyRandomMethod(SomeControl.BeginInvoke);
What would the method definition for MyRandomMethod be?
Part of the problem is that BeginInvoke has overloads, so the compiler gets confused as to which one I am try to pass as a parameter. Maybe I need to find a way to say which version of BeginInvoke I am referring to? (Though I would imagine that would be decided by the parameter type)
MyRandomMethodwould have to have a parameter with a delegate which matches one of the overloads forSomeControl.BeginInvoke. For example:or
(But please don’t overload
MyRandomMethoditself with both of these signatures, as otherwise you’re just asking for confusion.)