I have a delegate
delegate string Mathop<T,F>(T a,F b);
and I am declaring an event like
event Mathop<T,F> someevent;
But here I am getting an error. It says ‘T’ could not be found. I want my Mathop delegate to work as an eventhandler for my event.
What I am doing wrong here.
You need to enclose the event in a class which takes type parameters e.g.
You can’t subscribe to an event that doesn’t have concrete types defined – imagine if you could – you could add any delegate to that event as long as it took two parameters and returned a string!
With the above code, you should now be able to do something like
where MyMethod has the signature