title: return value from control.Invoke((MethodInvoker) delegate { /* ... */ }; I need some explanations
body: <p>What's the difference between #1 and #2:</p>
  
  <p>Code 1 (compiled ok):</p>
  
  <pre><code>        byte[] GetSomeBytes()
    {
              return (byte[])this.Invoke((MethodInvoker)delegate 
              { 
                  GetBytes(); 
              });
    }
  
    byte[] GetBytes()
    {
     GetBytesForm gbf = new GetBytesForm();
  
     if(gbf.ShowDialog() == DialogResult.OK)
     {
      return gbf.Bytes;
     }
     else
      return null;
    }
  </code></pre>
  
  <p>Code 2 (didn't complied ok)</p>
  
  <pre><code>int GetCount()
  {
         return (int)this.Invoke((MethodInvoker)delegate
         {
             return 3;            
         });
  }
  </code></pre>
  
  <p>Code #2 gives me <em>Since 'System.Windows.Forms.MethodInvoker' returns void, a return keyword must not be followed by an object expression</em>.</p>
  
  <p>How can I fix it? And why (do) complier think code #1 is right?</p>