title: Calling event of another class
body: <p>I am new to C# and programming in general and am trying to figure out how to use events. Previously I have been programming with ActionScript3, and there events are a special class that you inherit from if you want to create your own events, and then that event can be called by any other class.</p>
  
  <p>With C# I have tried to do something similar, like so:</p>
  
  <pre><code>public class EventManager
  {
      public delegate void TempDelegate();
      public static event TempDelegate eSomeEvent;
  }
  
  public class SomeOtherClass
  {
      //doing some stuff, then:
      if (EventManager.eSomeEvent != null)
      {
          EventManager.eSomeEvent();
      }
  }
  </code></pre>
  
  <p>This gives me a compiler error CS0070: The event 'EventManager.eSomeEvent' can only appear on the left hand side of += or -= (except when used from within the type 'EventManager')</p>
  
  <p>The information about this error over on the <a href="http://msdn.microsoft.com/en-us/library/033kfe9y%28v=vs.90%29.aspx" rel="nofollow">msdn</a> indicates that I should use <code>+=</code> instead of trying to call the event, but I don't really understand this. I'm not trying to subscribe anything from <code>SomeOtherClass</code> to the event delegate, I am just trying to call this event so that it starts executing those functions that are already subscribed to that event.</p>
  
  <p>So is it possible to do it this way? If not, is it at all possible to call an event that is of one class, from another class? I simply wish to reuse certain events in my classes rather than creating many similar ones in multiple classes.</p>
  
  <p>Any advice with this would be greatly appreciated!</p>