C# 委托与字典

private delegate int delStepDoSomething(object obj=null);
private static Dictionary<int , delStepDoSomething> stepDoSomething = new Dictionary<int , delStepDoSomething>();
private static Dictionary<int, Func<object,int>> stepDoSomething = new Dictionary<int,Func<object, int>>();

1.注意,上面2中方式的委托。都可以与字典绑定

2.Func作为委托,其参数没办法,给默认值

posted @ 2023-04-07 23:06  老杨_在路上  阅读(70)  评论(0)    收藏  举报