Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Typically, to gain the ability to dispatch events, you would simply subclass the EventDispatcher class (or a class that subclasses it). However, in this situation you are already subclassing the Proxy class, so you must take an alternative approach. The proper way to handle this is to use a combination of composition and the implementation of the IEventDispatcher interface. In other words, create a new EventDispatcher instance and store it in a property of your Config class.
Next, implement the IEventDispatcher interface, which will mandate that you have the same methods as the EventDispatcher class available in your Config class. Inside these methods, you will simply pass the call and parameters along to your EventDispatcher instance, as shown in Listing 15.7.