mardi 27 mars 2018

Add Event Handler using Reflection ? / Get object of type?

how to add a event handler myhandler using reflection if I only have the type AType of the event thrower?

Delegate myhandler = SomeHandler;

EventInfo info= AType.GetEvent("CollectionChanged");

info.AddEventHandler( ObjectOfAType, myhandler )





Aucun commentaire:

Enregistrer un commentaire