treeview逐层遍历是怎么做?
treeview逐层遍历是怎么做?如题:
for (List<Employee> ec = EmployeeCollection; ec != null && ec.Count > 0;) { foreach (Employee e in ec) { s += e.salary; } List<Employee> list = new List<Employee>(); foreach (Employee e in ec) { if (e.EmployeeCollection != null) list.AddRange(e.EmployeeCollection); } ec = list; }