title: Waiting for event to be handled
body: <p>I have a function, let's call it Func1 and <code>it contains</code> Func2 &amp; event handler.</p>
  
  <p>Now what I would like to achieve is <code>not let</code> function (Func1) return value till Func2 fires and handles event.</p>
  
  <p>Basically Func1 has string as return value and string value is set inside event handler. So I need to wait for event to be handled and then return value.</p>
  
  <p>Code Example</p>
  
  <pre><code>    public static string Fun1 ()
      {
          string stringToReturn = String.Empty;
          Func2(); //Func2 will after few sec fire event bellow 
  
          example.MyEvent += (object sender, WebBrowserDocumentCompletedEventArgs e) =&gt;
                                 {
                                     stringToReturn = "example"; //this wont be hardcoded
                                 };
  
          //wait for event to be handled and then return value
          return stringToReturn;
      }
  </code></pre>