void nodes_AfterCheck(object sender, ComboTreeNodeEventArgs e) { if (_cascadeCheckState) { _recurseDepth++; if (_recurseDepth == 1) { IEnumerator <ComboTreeNode> enumerator = ComboTreeNodeCollection.GetNodesRecursive(e.Node.Nodes, false); while (enumerator.MoveNext()) { if (_threeState) { enumerator.Current.CheckState = e.Node.CheckState; } else { enumerator.Current.Checked = e.Node.Checked; } } ComboTreeNode parent = e.Node.Parent; while (parent != null) { parent.CheckState = parent.GetAggregateCheckState(); parent = parent.Parent; } } _recurseDepth--; } Invalidate(); OnAfterCheck(e); }
/// <summary> /// Returns the previous selectable node, relative to the selected node. /// </summary> /// <returns></returns> public ComboTreeNode GetPrevSelectableNode() { bool started = false; IEnumerator <ComboTreeNode> e = ComboTreeNodeCollection.GetNodesRecursive(_nodes, true); while (e.MoveNext()) { if (started || (_selectedNode == null)) { if (IsNodeVisible(e.Current) && e.Current.Selectable) { return(e.Current); } } else if (e.Current == _selectedNode) { started = true; } } return(null); }
/// <summary> /// Returns the next displayable node, relative to the selected node. /// </summary> /// <returns></returns> private ComboTreeNode GetNextDisplayedNode() { bool started = false; IEnumerator <ComboTreeNode> e = ComboTreeNodeCollection.GetNodesRecursive(_nodes, false); while (e.MoveNext()) { if (started || (_selectedNode == null)) { if (IsNodeVisible(e.Current)) { return(e.Current); } } else if (e.Current == _selectedNode) { started = true; } } return(null); }