title: Invoke in a static method?
body: <p>I have the following code inside a <code>public</code> method, however how would I use it in a static method? <code>o</code> is a <code>static TextBox</code>?</p>
  
  <pre><code>Invoke((MethodInvoker)delegate {
      o.Text = str + Environment.NewLine;
  });
  </code></pre>
  
  <p>I have read up on the <a href="https://msdn.microsoft.com/en-us/library/a89hcwhh(v=vs.110).aspx" rel="nofollow">MethodInfo</a> class in the <code>System.Reflection</code> namespace, but nothing seems to be working. Just to show you, I want something that does this:</p>
  
  <pre><code>public static void writeOut(string str)
  {
      Invoke((MethodInvoker)delegate {
          o.Text = str + Environment.NewLine; // runs on UI thread
      });
  }
  </code></pre>
  
  <p>That code does not work, but I want to know how to do something that can call in <code>invoke</code> in a static method, like the snippet above.</p>