Need code explanation in C#
<p>I need a detailed explanation of the following code line-by-line and how the flow goes, for example, when I debug. I have just used this code in my program for avoiding a <code>cross thread access error</code>. The code is working fine, but what is this code is all about?</p>

<pre><code>delegate void updateTextField(string Text);
private void updateText(string Text)
{
    if (txtDelegate.InvokeRequired)
    {
        updateTextField del = new updateTextField(updateText);
        txtDelegate.Invoke(del, new object[] { Text });
    }
    else
    {
        txtDelegate.Text = Text;
    }
}
</code></pre>

<p>This method is called under <code>backgroundWorker_DoWork()</code>:</p>

<pre><code>updateText("using delegate");
</code></pre>

<p>I also need an explanation for delegates. I read about it, but what I understood is that a delegate is like a pointer to a function, but I need a clean explanation with a simple example. Think of me as a novice.</p>
