这两者之间有什么区别?
有使用Lambda表达式的原因吗?
Invoke((MethodInvoker) delegate {
checkedListBox1.Items.RemoveAt(i);
checkedListBox1.Items.Insert(i, temp + validity);
checkedListBox1.Update();
}
);
vs
Invoke((MethodInvoker)
(
() =>
{
checkedListBox1.Items.RemoveAt(i);
checkedListBox1.Items.Insert(i, temp + validity);
checkedListBox1.Update();
}
)
);
有使用Lambda表达式的原因吗?
(MethodInvoker)
是将委托和Lambda强制转换为MethodInvoker类型吗?什么样的表达式不需要(MethodInvoker)
强制转换?