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大同小异,就不赘述了。

相关文章:

  • 2021-09-20
  • 2021-11-27
  • 2022-12-23
  • 2023-04-03
  • 2021-05-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2023-04-03
  • 2021-10-27
  • 2021-07-12
相关资源
相似解决方案