title: Calling C# events from outside the owning class?
body: <p>Is it possible under any set of circumstances to be able to accomplish this?</p>
  
  <p>My current circumstances are this:</p>
  
  <pre><code>public class CustomForm : Form
  {
      public class CustomGUIElement
      {
      ...
          public event MouseEventHandler Click;
          // etc, and so forth.
      ...
      }
  
      private List&lt;CustomGUIElement&gt; _elements;
  
      ...
  
      public void CustomForm_Click(object sender, MouseEventArgs e)
      {
          // we might want to call one of the _elements[n].Click in here
          // but we can't because we aren't in the same class.
      }
  }
  </code></pre>
  
  <p>My first thought was to have a function similar to:</p>
  
  <pre><code>internal enum GUIElementHandlers { Click, ... }
  internal void CustomGUIElement::CallHandler(GUIElementHandler h, object[] args) {
      switch (h) {
          case Click:
              this.Click(this, (EventArgs)args[0]);
              break;
          ... // etc and so forth
      }
  }
  </code></pre>
  
  <p>It's a horribly ugly kludge, but it should work... There must be a more elegant solution though? The .NET library does this all the time with message handlers and calling events in Control's. Does anyone else have any other/better ideas?</p>