Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to retrieve the event's delegate

I am wondering whether I can retrieve an event's delegate list of a class object?

like image 863
user496949 Avatar asked Dec 02 '25 05:12

user496949


1 Answers

If you have implemented the event yourself, then you can call GetInvocationList on the delegate assuming you have access to it (i.e., to get the invocation list from another class the delegate field must be public or the invocation list must be returned from a public method).

If it's an automatic event, then the field is private and you can only call GetInvocationList from within your class. You will need to do it and return the results from a public method to get the list from another class.

like image 140
Jon Avatar answered Dec 03 '25 18:12

Jon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!