参考源:https://zhuanlan.zhihu.com/p/136464385
(1)Action委托就是C#定义的无返回值的委托类型(已定义可直接使用)
最多16个参数 Action委托与自定义无返回值自定义委托是一致的。如下图,两个代码块内容一致。
//无参数
Action nullParam;
//一个参数
Action<string> oneParam;
//两个参数
Action<int, string> twoParam;
//三个参数
Action<int, string, bool> threeParam;
..................
//无参数
delegate void nullParam();
//一个参数
delegate void oneParam(string s);
//两个参数
delegate void twoParam(int n, string s);
//三个参数
delegate void threeParam(int n, string s, bool b);
.............