private void MyTreeToolStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { switch (e.ClickedItem.Name) { case "Refresh": { string[] openItem = _myTree.OpenItems; _myTree.BeginUpdate(); _myTree.UnloadTreeData(); _myTree.LoadTreeData(); _myTree.OpenItems = openItem; _myTree.EndUpdate(); break; } case "CollapseAll": { _myTree.CollapseAll(); break; } case "ExpandAll": { TreeNode nextVisibleNode = _myTree.Nodes[0]; while (nextVisibleNode != null) { TreeNode tempNode = nextVisibleNode; nextVisibleNode = nextVisibleNode.NextVisibleNode; tempNode.Expand(); } break; } case "allTmplt": int i = 0; break; } }
public void UnloadTreeData() { _myTree.UnloadTreeData(); _toolStrip.SetVisualForDisposeTree(); _statusStrip.DestoryStatusStripInfo(); }