The closest you can come is to use Delegate
- the caller will need to pick the right delegate type. That's exactly why Control.Invoke
uses Delegate
instead of a specific delegate type.
Alternatively, there's MethodInfo
as HackedByChinese suggests. Which one you should use depends on what you're trying to achieve - each is useful in different contexts. If you're trying to describe a method, then MethodInfo
is probably the best approach. If you're trying to represent a callable action of some kind (which can take parameters and have a return value) then a delegate is probably more useful.
If you tell us more about what you're trying to achieve, we may be able to help you more.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…