Action<string> methodCall = (x) => { x += "haha"; MessageBox.Show(x); };
public event Action<string> BoilerEventLog;
private void button2_Click(object sender, EventArgs e)
{
BoilerEventLog += new Action<string>(methodCall);
BoilerEventLog("123");
}
其实很好理解,Func和Action还有Predicate本质就是委托。
Func和Action大同小异,就不赘述了。
转载于:https://www.cnblogs.com/hanjun0612/p/9779792.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)