Events and commissioned in-depth understanding
Others
2019-10-14 14:21:47
views: null
- Event Publisher:
- Some pre-defined function pointers, available to subscribers of events
- In the local publisher suitable place to study these functions pointer to a function, enabling calls to functions provided by the event subscriber
- Event subscribers: to assign your own function approach function pointer to the event publisher offered
- Using the Event
- Delegates provide a similar callback function for each additional subscriber, the publisher needs to provide a delegate object is referenced to provide to subscribers
- If you use a delegate, you need to define a lot delegate object within an event publisher references to subscribers for each event
- Callback function pointers list released by the publisher event publisher is actually provided externally
- C # implement event mechanisms
- Publishers define a delegate type
- Publishers define an event, and events related to the word delegate defined above
- Subscribers produces a delegate instance, and add it to the list of delegates
Origin www.cnblogs.com/xadlriver/p/11670443.html