1.无返回参数用Action,执行testA(),输出顺序为132。
private void testA()
{
this.test(t =>
{
bool a = t;
MessageBoxHelper.ShowInformationMsg("3");
});
}
private void test(Action<bool> action)
{
MessageBoxHelper.ShowInformationMsg("1");
action(true);
MessageBoxHelper.ShowInformationMsg("2");
}