List<T>的ForEach方法(可以使用“语句lambda”作为其参数),如下例子:
2013-05-30 08:58
696 查看
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);
});
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);
});
相关文章推荐
- error C2648: “MyDoublyLinkedlist<int>::length”: 将成员作为默认参数使用要求静态成员
- 可以把List<String>传递给一个接受List<Object>参数的方法吗?
- mybatis list<map>作为参数 foreach循环
- SpringMVC 在业务控制方法中收集数组及List<JavaBean>参数
- 在Silverlight中使用List<Object>构造交叉表作为Silverlight的DataGrid的数据源
- <django中render_to_response的可选参数和使用方法>
- 【C#】List<T>.ForEach 方法
- CMake 使用方法 & CMakeList.txt<转>
- List<T> 的条件筛选 where使用方法
- getParameterMap()的返回值为Map<String, String[]>,从其中取得请求参数转为Map<String, String>的方法如下:
- Spring配置文件中使用ref local与ref bean的区别. 在ApplicationResources.properties文件中,使用<ref bean>与<ref local>方法如下
- <c:foreach>同时遍历两个list的方法
- 【转载】[C#/ASP.NET]List<>中Sort()、Find()、FindAll()、Exist()的使用方法
- hibernate使用本地sql语句查询,解决List<Object[]>转换成List<实体>
- 使用BindingList<>作为DataGridView控件的数据源
- JS 使用List<Object> 对象中的Object对象的某个属性的临时处理方法
- Spring配置文件中使用ref local与ref bean的区别. 在ApplicationResources.properties文件中,使用<ref bean>与<ref local>方法如下
- 接口测试入门(3)--使用httpClient进行登录用例操作/set-cookies验证/ List<NameValuePair>设置post参数/json解析
- List<T>下的Find,FindAll等条件过滤函数的使用方法
- [C#/ASP.NET]List<>中Sort()、Find()、FindAll()、Exist()的使用方法