不同类型的委托变量的共同类型
代码示例:
var A = new Dictionary<int, MulticastDelegate>(); A.Add(0, new Func<int>(() => 123)); A.Add(1, new Func<int, int>(i => i * i)); var a = A[0].Method.Invoke(this, null); var b = A[1].Method.Invoke(this, new object[] { 3 });
代码示例:
var A = new Dictionary<int, MulticastDelegate>(); A.Add(0, new Func<int>(() => 123)); A.Add(1, new Func<int, int>(i => i * i)); var a = A[0].Method.Invoke(this, null); var b = A[1].Method.Invoke(this, new object[] { 3 });