• List<T>的ForEach方法(可以使用“语句lambda”作为其参数),如下例子:


    private void OKButton_Click(object sender, RoutedEventArgs e) {
                this.DialogResult = true;
          //  GetSelectedJZ(Shu.Items[0] as TreeViewItem);
                //选择后返回
                if (GetJZ_Event!=null) {
                //排除不是建筑的选项
                    V_FQ.Rows.Where(a =>
                    V_FQ.Value(a, "cc").ToString() == "1"
                    ).ToList().ForEach(b => {
                        if (Shu.SelectedItemsZJ.Contains(V_FQ.Value(b, "zj").ToString()))
                            Shu.SelectedItemsZJ.Remove(V_FQ.Value(b, "zj").ToString());
                    });
                    GetJZ_Event(Shu.SelectedItemsZJ);
                }
            }

     _graphicsManager.Graphics.Where<Graphic>(
                            (item) =>
                            {
                                if ((ShowAperture)item.Symbol.GetValue(PolicePictureMarkerSymbol.ShowApertureProperty) == ShowAperture.Yes)
                                {
                                    item.SetShowAperture(ShowAperture.No);
                                    return true;
                                }
                                else
                                {
                                    return false;
                                }
                            }
                        );


                        _graphicsManager.Graphics.Where<Graphic>(item => (ShowAperture)item.Symbol.GetValue(PolicePictureMarkerSymbol.ShowApertureProperty) == ShowAperture.Yes).ToList().ForEach(p => p.SetShowAperture(ShowAperture.No));

                        _graphicsManager.Graphics.Where<Graphic>(item => (ShowAperture)item.Symbol.GetValue(PolicePictureMarkerSymbol.ShowApertureProperty) == ShowAperture.Yes).ToList().ForEach((p) =>
                            {
                                p.SetShowAperture(ShowAperture.No);
                            });

  • 相关阅读:
    Java中常见数据结构:List与Map
    JAVA 双重检查锁定和延迟初始化
    Spring 读取配置文件(二)
    Spring 读取配置文件(一)
    Java配置文件读取和路径设置
    动态设置spring配置PropertyPlaceholderConfigurer location的路径
    MySQL 数据库备份种类以及经常使用备份工具汇总
    打印二叉树两个叶子节点间的路径
    读书报告之《改动代码的艺术》 (I)
    虚幻引擎自带的创建插件的插件
  • 原文地址:https://www.cnblogs.com/changbaishan/p/3107436.html
Copyright © 2020-2023  润新知