c# - Passing BeginInvoke as a parameter -
suppose want have method passes begininvoke method of object parameter. how that? call looks this:
myrandommethod(somecontrol.begininvoke);
what method definition myrandommethod be?
part of problem begininvoke has overloads, compiler gets confused 1 try pass parameter. maybe need find way version of begininvoke referring to? (though imagine decided parameter type)
myrandommethod
have have parameter delegate matches 1 of overloads somecontrol.begininvoke
. example:
public void myrandommethod(func<delegate, iasyncresult> foo)
or
public void myrandommethod(func<delegate, object[], iasyncresult> foo)
(but please don't overload myrandommethod
both of these signatures, otherwise you're asking confusion.)
Comments
Post a Comment