有人能解释一下以下代码吗:
this.Invoke((MethodInvoker)delegate
{
lblNCK.Text = cncType;
});
这是它的来源:
string cncType;
if (objDMainCncData != null)
{
int rc = objDMainCncData.Init(objDGroupManager.Handle);
if (rc == 0)
{
cncType = objDMainCncData.GetCncIdentifier();
if (cncType != string.Empty)
{
if (cncType.ToUpper().IndexOf("+") != -1)
_bFXplus = true;
this.Invoke((MethodInvoker)delegate
{
lblNCK.Text = cncType;
});
}
}
else
{
DisplayMessage("objDMainCncData.Init() failed ! error : " + rc.ToString());
}
}
}
我不明白 "this.Invoke((MethodInvoker)delegate" 的用途。
提前感谢您。
彼得。