Short answer: you need to follow him.
for example: there List<Node> childrenmay be some kind of custom collection, for example
public class Children : List<Node> {
public Node Parent {get;set;};
public Children(Node pr) {
Parent = pr;
}
}
So:
.....
public Node()
{
children = new Children (this);
}
...
Or if I follow your logic correctly:
foreach (var child in node.children)
{
var found = Find(child, name);
if (found != null)
return found;
}
source
share