That's not too bad. The one performance related change I would make is to change this:
foreach (var child in treeBo.Nodes)
{
Find(child, id, ref temp);
}
to this:
foreach (var child in treeBo.Nodes)
{
Find(child, id, ref temp);
if (temp != null) break;
}
If you've already found the match then there's no need to continue the loop, is there?
A style change I would make would be to change
Find
to return a node instead of taking a
ref
param as the return value, but that's just a personal preference thing.