How to specify an IMethod as the callback for an event?

I'd like to specify an introduced method on a TypeAspect as the callback for an event handler. 1) When I attempt to just pass it in via a template, I get squigglies: dictionary.OnDictionaryChanged += myDictionaryChangedMethod; //Doesn't like this since IMethod isn't a System.EventHandler 2) How can I similarly remove the event in a subsequently introduced Dispose() method? Thank you!
3 Replies
Gael Fraiteur
Gael Fraiteur17mo ago
Good point. We haven't thought about this point. It seems you need a StatementBuilder for now.
Gael Fraiteur
Gael Fraiteur17mo ago
GitHub
Feature: reference IMethod as a delegate in a template · Issue #184...
There is currently no way to reference an introduced method or an IMethod as a delegate i.e. dictionary.OnDictionaryChanged += myDictionaryChangedMethod; //Doesn't like this since IMethod isn&#...
Whit
WhitOP16mo ago
Always an excellent fallback those StatementBuilders - thank you! Closing as this has a Github ticket now
Want results from more Discord servers?
Add your server