title: How can a C# Method return only after Event has been fired?
body: <p>I have a DLL <code>SomeLib.dll</code>, that contains a <code>DeleteHandler</code> object:</p>
  
  <pre><code>public class DeleteHandler
  {
      private _handlerToServerObj;
  
      public DeleteHandler()
      {
          _handlerToServerObj = new HandlerToServerObj(/* ... */);
          _handlerToServerObj.OnDelete += new OnDeleteEventHandler(OnDeleteEH);
      }
  
      public void Delete(string id)
      {
          _handlerToServerObj.Delete(id);
      }
  
      private void OnDeleteEH(string id)
      {
          //
      }
  }
  </code></pre>
  
  <p>How it works:</p>
  
  <ul>
  <li><code>_handlerToServerObj.Delete(id)</code> is sending a message to the server and the call immediatly returns;</li>
  <li>when the server has successfully deleted the item, it will fire the <code>OnDelete</code> event.</li>
  </ul>
  
  <p>This library is normally used by a <code>WinForms</code> application.</p>
  
  <p>Normally, I would like for the <code>Delete()</code> method to return <strong>only</strong> after the server has indeed deleted the item (i.e., the <code>OnDelete</code> event is fired and, therefore, the <code>OnDeleteEH</code> is executed).</p>
  
  <p>I've tried using a <code>ManualResetEvent</code>, but with no success (i.e., the <code>OnDeleteEH</code> is never called):</p>
  
  <pre><code>private ManualResetEvent _waitHandle = new ManualResetEvent(false);
  
  public void Delete(string id)
  {
      _waitHandler.Reset();
      _handlerToServerObj.Delete(id);
      _waitHandle.WaitOne();
  }
  
  private void OnDeleteEH(string id)
  {
      //
      _waitHandle.Set();
  }
  </code></pre>
  
  <p>Or:</p>
  
  <pre><code>private ManualResetEvent _waitHandle = new ManualResetEvent(false);
  
  public void Delete(string id)
  {
      _waitHandler.Reset();
      Thread thread = new Thread(PrivateDelete);
      thread.Start(id);
      _waitHandle.WaitOne();
  }
  
  private void PrivateDelete(string id)
  {
      _handlerToServerObj.Delete(id);
  }
  
  private void OnDeleteEH(string id)
  {
      //
      _waitHandle.Set();
  }
  </code></pre>
  
  <p>Is this design valid? If yes, what are the mistakes that I'm making while implementing? If no, ca you please suggest corrections?</p>
  
  <p>[Edit 1]</p>
  
  <p>Corrected some mistakes with respect to the code.</p>