title: C# events with custom event accessor (add and remove)
body: <p>Can someone explain to me how custom event accessor works?
  I have read a couple of articles on google but still could not understand. Also, when to use it?</p>
  
  <p>I have the following code snippet from my project. If someone can explain this to me it would be really great.</p>
  
  <pre><code>private event Action&lt;int&gt; ActivityChanged = delegate {};
  
  event Action&lt;int&gt; IActivityFacade.ActivityChanged
  {
      add
      {
          ActivityChanged += value;
          value(GetSelectedActivity()); 
      }
      remove { ActivityChanged -= value; }
  }
  </code></pre>