zoukankan      html  css  js  c++  java
  • Action、Action<T>、Func<T> 匿名函数的写法

            void ht_HLB_Set(Dictionary<int, int> dic)
            {
                //匿名函数
                Action<int> fun = (int jhShare_Iid) =>
                {
                    try
                    {
                        switch (dic[jhShare_Iid])
                        {
                            case 0: s.Color = GradientButtons.ColorEnum.red; break;
                            case 1: s.Color = GradientButtons.ColorEnum.blue; break;
                            case 2: s.Color = GradientButtons.ColorEnum.white; break;
                        }
                    }
                    catch { };
                };
                //设置计划员按钮颜色
                this.li_btnJHY.ForEach(s => { fun((s.Value as rgjh_jhy_Models).jhShare_Iid); });
                this.li_btnSC.ForEach(s => { fun((s.Value as rgjh_jhy_Models).jhShare_Iid); });
            }
  • 相关阅读:
    讨论一下,乌云漏洞库的学习方法
    a
    asss
    密码重置
    SQL注入2
    起名字真难
    Header
    SQL注入1
    伪装者
    ofbiz 代码日记
  • 原文地址:https://www.cnblogs.com/chengulv/p/4748950.html
Copyright © 2011-2022 走看看