分类

链接

2025 年 6 月
 1
2345678
9101112131415
16171819202122
23242526272829
30  

近期文章

热门标签

新人福利,免费薅羊毛

if else过多应该使用策略模式

      public class Test     {           private int type;         Dictionary<int, Action> actionList = new Dictionary<int, Action>();           public Test(int _type)         {             type = _type;             actionList.Add(1, () => { /*todo 1 */ });             actionList.Add(2, () => { /*todo 2 */});             actionList.Add(3, () => { /*todo 3 */});             actionList.Add(4, () => { /*todo 4 */});           }         public void Do(...

.NET 暂无评论 阅读(830)