title: Doing your own custom .NET event processing loop
body: <p>A few years ago, I read a book that described how you could override the default event 'dispatcher' implementation in .NET with your own processor.</p>
  
  <pre><code>    class foo {
         public event EventHandler myEvent;
         ...
      }
  
      ...
        myFoo.myEvent += myBar1.EventHandler;
        myFoo.myEvent += myBar2.EventHandler;
  </code></pre>
  
  <p>Whenever the event fires, both myBar1 and myBar2 handlers will be called.</p>
  
  <p>As I recall, the default implementation of this loop uses a linked list and simply iterates over the list and calls the EventHandler delegates in order.</p>
  
  <p>My question is two fold: </p>
  
  <ol>
  <li>Does someone know which book I was reading?</li>
  <li>Why would you want to override the default implementation (which might be answered in the book)?</li>
  </ol>
  
  <p>Edit: The book I was referring to was indeed Jeffrey Richter's CLR via C#</p>