When you use expression to burden and manage assemblies, you will not need vocabulary properties similar to the C# += agent or the aesthetic standard AddHandler statement to connect activities. The subsequent processes show suggestions get together a current solution to an occasion by getting every one of the necessary types through reflection, and the ways to generate a dynamic technique utilizing expression give off and connect it up to an event.
For an additional method to connect an event-handling delegate, start to see the rule situation for any AddEventHandler approach to the EventInfo class.
To connect a delegate utilizing expression
Bunch an installation that contains a sort that lifts parties. Assemblies are full of the construction.Load way. Keeping this illustration quick, a derived type in the current meeting is used, so the GetExecutingAssembly technique is always load the present assembly. (więcej…)