title: Observer pattern with delegate and events using an event array
body: <p>We have a class which manages many queues that store data. I want a user to get notified when new data is added to each of these queues. I'd like to use the observer pattern using delegate and events. Normally for a single event and source, we'd do:</p>
  
  <pre><code>public delegate void NewDataAddedDelegate();
  public event NewDataAddedDelegate NewDataAdded;
  </code></pre>
  
  <p>and for the observer:</p>
  
  <pre><code>qManager.NewDataAdded += new qManager.NewDataAddedDelegate(getNewDataFunc);
  </code></pre>
  
  <p>But in this case, we have, say, 10 queues, each of which can receive data arbitrarily. So we'd like the observer functions to subscribe to an individual queue. We thought we could do:</p>
  
  <pre><code>public delegate void NewDataAddedDelegate();
  public event NewDataAddedDelegate [] NewDataAdded;  // can't do this
  </code></pre>
  
  <p>and in the constructor of qManager:</p>
  
  <pre><code>NewDataAdded = new NewDataAddedDelegate[numberOfQueues];
  </code></pre>
  
  <p>and in the observer:</p>
  
  <pre><code>qManager.NewDataAdded[0] += new qManager.NewDataAddedDelegate(getNewDataFunc0);
  qManager.NewDataAdded[1] += new qManager.NewDataAddedDelegate(getNewDataFunc1);
  </code></pre>
  
  <p>but no go, since the event is expected to be a delegate type, not an array of delegates type.</p>
  
  <p>Any ideas on how to approach this problem?</p>