What is the difference between the two?
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();
}
)
);
Is there any reason to use the lambda expression? And is (MethodInvoker)
casting delegate and lambda into type MethodInvoker? What kind of expression would not require a (MethodInvoker)
cast?