public void expand() { if (!_isExpanded) { TreeNodeEventArgs e = new TreeNodeEventArgs(this, TreeNodeAction.Expand); _owner._nodeBeforeExpand(this, e); if (!e.Cancel) { _isExpanded = true; _owner._nodeExpanded(this); } } }
public void collapse() { if (_isExpanded) { TreeNodeEventArgs e = new TreeNodeEventArgs(this, TreeNodeAction.Collapse); _owner._nodeBeforeCollapse(this, e); if (!e.Cancel) { _isExpanded = false; _owner._nodeCollapsed(this); } } }