Custom Publish / Subscribe to an Event and Create a .Net Event in Winforms
In fact, I went beyond that. For example, you can create a SystemEvent and publish it to a topic named "Application.UI.TreeInstance. [InstanceName] .Node.Clicked" and if you register for something like "Application". or "Aplication.UI". or "Application.UI.TreeInstance. [InstanceName] .Node. *" or a complete object that you invoke from your delegate via multicast and receive the event. SystemEvent, which you can define as you wish; it has a ValueNamePairCollection and a public interface for retrieving data of your choice. You can register for synchronous and asynchronous processing and deferral. Cancel registration. Now my UI elements handle events they are interested in without knowing who is posting them.If the community is interested in things like this, I could package the code and make it available so we can share and improve. I tested it and it worked 100%. I also wrote several monitoring graphs that you can see in real time what is happening with publications and subscriptions, as well as with registrations and unregistered data.
source to share