private void CreateTree() { root = new Node("Root"); for (int i = 0; i < 1000; i++) { var n = new Node("Node " + i); root.AddChild(n); for (int j = 0; j < 10; j++) { var subNode = new Node("SubNode " + i + "-" + j); n.AddChild(subNode); for (int k = 0; k < 10; k++) { var subSubNode = new Node("SubNode " + i + "-" + j + "-" + k); subNode.AddChild(subSubNode); } } } }
private void AddChild(IEnumerable<Node> draggedNodes, Node targetNode) { //build list of nodes without childs var list = ExcludeChild(draggedNodes); //change parent foreach (var n in list) { n.Parent.Childs.Remove(n); targetNode.AddChild(n); } }