public static Tree Build(_Nodes node, int rows = 4) { var root = new Tree(node); if (rows == 0) { return(root); } var children = Database.SelectChildren(node.ID, null).Select(item => item.Child); foreach (var child in children) { var item = Build(child, rows - 1); item.Parent = root; root.Children.Add(item); } return(root); }
public Tree(_Nodes node) { Current = node; }