private void ApplyNodesControlStateRecursive(Pair[] nodesState, WebTreeNodeCollection nodes) { for (int i = 0; i < nodesState.Length; i++) { Pair nodeState = nodesState[i]; object[] values = (object[])nodeState.First; string itemID = (string)values[0]; WebTreeNode node = nodes.Find(itemID); if (node != null) { if (!node.IsEvaluated) { bool isEvaluated = (bool)values[2]; if (isEvaluated) { node.EvaluateExpand(); } } if (node.IsEvaluated) { bool isExpanded = (bool)values[1]; node.IsExpanded = isExpanded; if (node.Children.Count == 0) { node.IsExpanded = false; } } ApplyNodesControlStateRecursive((Pair[])nodeState.Second, node.Children); } } }
private void Node332Button_Click(object sender, EventArgs e) { WebTreeNode node3 = (WebTreeNode)WebTreeView.Nodes[3]; node3.EvaluateExpand(); WebTreeNode node33 = (WebTreeNode)node3.Children[3]; node33.EvaluateExpand(); WebTreeNode node332 = (WebTreeNode)node33.Children[2]; node332.EvaluateExpand(); node332.IsSelected = true; }