Invoke Method #6115
-
I'd like to build an Event class that wraps a list of TDelegates and exposes a custom Invoke method that:
How do I accomplish #1? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I've done (1) by exposing |
Beta Was this translation helpful? Give feedback.
-
Is there an ask for a language feature here? |
Beta Was this translation helpful? Give feedback.
-
Your three options are either 1) create a whole bunch of versions for each delegate signature (which is lots of repetition) or 2) use reflection to invoke the |
Beta Was this translation helpful? Give feedback.
I've done (1) by exposing
public TDelegate Invoke { get; }
. The language doesn't provide a facility to change a method signature based on the signature of a delegate type parameter.