If you use representation to fill and powered assemblies, you cannot utilize tongue qualities like C# += agent and/or artistic vital AddHandler statement to connect happenings. The below techniques showcase a way to connect a pre-existing technique to a conference by obtaining most of the essential varieties through representation, and the way to build a dynamic way utilizing click tids link here now representation produce and lift it up to an event.
For an additional method to hook up an event-handling delegate, see the laws example for all the AddEventHandler technique of the EventInfo lessons.
To attach a delegate utilizing representation
Load a meeting which has a sort that lifts parties. Assemblies usually are laden with the forum.Load strategy. To keep this example painless, a derived type with the current economic installation is utilized, therefore, the GetExecutingAssembly method is used to burden the latest system.
Come a sort target stage the character, and create an instance belonging to the type. The CreateInstance(kind) method is utilized in all of the following rule considering that the kind has a parameterless constructor. There are plenty of various other overloads belonging to the CreateInstance strategy which you can use in the event the kind that you are starting does not have a parameterless constructor. The brand new circumstances was put as kinds item to keep up the literary composition that nothing is recognized about the set-up. (picture helps you take advantage of the type in an assembly lacking the knowledge of her figure upfront.)