title: C# has to subscribe to an event before event called
body: <p>I want to implement a fast way to add listener to an event, my implementation:</p>
  
  <pre><code>public class AccountManager 
  {
  
      public delegate void CheckIfLoggedInListener(EventArgs e);
      public event CheckIfLoggedInListener SetCheckIfLoggedInListener;
  
      public void CheckIfLoggedIn()
      {                
           if(SetCheckIfLoggedInListener!=null)
               SetCheckIfLoggedInListener(new EventArgs("e"));
      }
  }
  </code></pre>
  
  <p>Right now, I have to set listener first, then invoke the method, which can be easily messed up if other developer doesn't pay attention:</p>
  
  <pre><code>//this will not work, because you invoke the event before subscribing
  accountManager.CheckIfLoggedIn();
  accountManager.SetCheckIfLoggedInListener += (e) =&gt; { Debug.Log(e.param); };
  </code></pre>
  
  <p>I wonder if there is a way to make the order  not mandatory? </p>