title: C# Events - Raising, Subscribing from two different projects in one solution
body: <p>My goal is to create an event, raise the event in Project #1, have Project #2 subscribe to the event so that I can hit some code in Project #2. I was advised to do it this way because I cannot reference the code in Project #2.</p>
  
  <p>I'm not familiar with events and have been researching the last hour. Is there anyone that can provide example code on how to do this? What I have now is not working.</p>
  
  <pre><code>// Creating the event
  
  public event EventHandler UpdateUIEvent;
  
  // Raising the event in Project #1
  
  protected override void ResetProperties() 
  {
      this.filePath = string.Empty;
      EventArgs e = new EventArgs();
      UpdateUIEvent(this, e);  // this kills my program
  }
  
  // Subscribing to the event in Project #2
  
  protected override void ClearAll()
  {
      boEncrypt.UpdateUIEvent += new EventHandler ?? // Not sure how to subscribe here
      tbFile.text = string.Empty;
  }
  </code></pre>