【发布时间】:2011-10-13 07:03:13
【问题描述】:
两者有什么区别?
Invoke((MethodInvoker) delegate {
checkedListBox1.Items.RemoveAt(i);
checkedListBox1.Items.Insert(i, temp + validity);
checkedListBox1.Update();
}
);
对
Invoke((MethodInvoker)
(
() =>
{
checkedListBox1.Items.RemoveAt(i);
checkedListBox1.Items.Insert(i, temp + validity);
checkedListBox1.Update();
}
)
);
有什么理由使用 lambda 表达式吗? (MethodInvoker) 是否将委托和 lambda 转换为 MethodInvoker 类型?什么样的表达式不需要(MethodInvoker) 演员表?
【问题讨论】:
标签: c# delegates lambda invoke method-invocation