"Nicholas Paldino [.NET/C# MVP]" wrote:
// Make a copy.
List<List<T>b = a.ConvertAll(delegate(T input) { return input; });
This won't compile - you need to write "ConvertAll<List<T>>". More
importantly, this only clones the 'outer list' - you get a new list of
the same inner List<Telements. If you want a wholly independent copy
(so that changing one of the lists in the original tree doesn't affect
the copy) you need
List<List<T>DeepCopy =
List.ConvertAll<List<T>>(delegate(List<TBranch)
{
return Branch.ConvertAll<T>(delegate(T Leaf){return Leaf;});
});
--
..NET 2.0 for Delphi Programmers
www.midnightbeach.com/.net
Delphi skills make .NET easy to learn In print, in stores.