title: Remove a delegate from an event
body: <p>I have an event as follows:</p>
  
  <pre><code>public event EventHandler&lt;CustomEventArgs&gt; RaiseCustomEvent;
  </code></pre>
  
  <p>Here is some code to remove a delegate from the above event that I have working:</p>
  
  <pre><code>public void RemoveDelegate(Delegate del)
  {
      RaiseCustomEvent -= (EventHandler&lt;CustomEventArgs&gt;)del;
  }
  </code></pre>
  
  <p>Here is some code that I have written to remove a delegate where I know the event name:</p>
  
  <pre><code>public void RemoveRaiseCustomEventDelegate(Delegate del, string eventName)
  {
      var field = this.GetType().GetField(eventName, BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField);
  
      var fieldValue = field.GetValue(this) as EventHandler&lt;CustomEventArgs&gt;;
      fieldValue -= (EventHandler&lt;CustomEventArgs&gt;)del;
  }
  </code></pre>
  
  <p>In the above code, the <code>fieldValue</code> is set to null, however, when the event is raised, there is still a subscriber.</p>
  
  <p>Can I please have some help to remove a delegate from an event, where I only have the event name?</p>