title: Using C# MethodInvoker.Invoke() for a GUI app... is this good?
body: <p>Using C# 2.0 and the MethodInvoker delegate, I have a GUI application receiving some event from either the GUI thread or from a worker thread.</p>
  
  <p>I use the following pattern for handling the event in the form:</p>
  
  <pre><code>private void SomeEventHandler(object sender, EventArgs e)
  {
      MethodInvoker method = delegate
          {
              uiSomeTextBox.Text = "some text";
          };
  
      if (InvokeRequired)
          BeginInvoke(method);
      else
          method.Invoke();
  }
  </code></pre>
  
  <p>By using this pattern I do not duplicate the actual UI code but what I'm not sure about is if this method is good.</p>
  
  <p>In particular, the line</p>
  
  <pre><code>method.Invoke()
  </code></pre>
  
  <p>does it use another thread for invoking or does it translate somewhat to a direct call to the method on the GUI thread?</p>