【发布时间】:2015-06-28 09:42:39
【问题描述】:
谁能帮我看看这段代码是如何工作的。 IEnumarable 如何保存在内存中 var 在这种情况下到底做了什么?为什么他们在这段代码中使用 concat 它到底是什么连接
public IEnumerable<Control> GetAll(Control control,Type type)
{
var controls = control.Controls.Cast<Control>();
return controls.SelectMany(ctrl => GetAll(ctrl,type)).Concat(controls)
.Where(c => c.GetType() == type);
}
【问题讨论】:
标签: c# linq ienumerable