protected override TreeViewItem BuildRoot() { _id = 0; _root = PreOrder(RedDotMananger.Instance.Root); _root.depth = -1; SetupDepthsFromParentsAndChildren(_root); return(_root); }
private RedDotTreeViewItem PreOrder(RedDotTreeNode root) { if (root == null) { return(null); } RedDotTreeViewItem item = new RedDotTreeViewItem(_id++, root); if (root.ChildCount > 0) { foreach (RedDotTreeNode child in root.ChildNodes) { item.AddChild(PreOrder(child)); } } return(item); }