C# Class Open.Core.Helpers.TreeHelper

Utility methods for working with Tree data-structures.
显示文件 Open project: philcockfield/Open.TestHarness.SL

Public Methods

Method Description
DeselectChildren ( ITreeNode parent ) : int

Deselects all children of the given node.

FirstDescendent ( ITreeNode parent, FuncBool predicate ) : ITreeNode

Gets the first descendent node that matches the given predicate.

FirstRemainingParent ( ITreeNode root, ITreeNode orphan ) : ITreeNode

Retrieves the first ancestor of a node that still exists as a descendent of the root node.

Useful for when a node is removed, and you want to move a view to the reamining parent.

FirstSelectedChild ( ITreeNode parent ) : ITreeNode

Retrieves the first selected child node.

HasSelectedChild ( ITreeNode parent ) : bool

Determines whether at least one of the children of the given node are selected.

Method Details

DeselectChildren() public method

Deselects all children of the given node.
public DeselectChildren ( ITreeNode parent ) : int
parent ITreeNode The node to deselect the children of.
return int

FirstDescendent() public method

Gets the first descendent node that matches the given predicate.
public FirstDescendent ( ITreeNode parent, FuncBool predicate ) : ITreeNode
parent ITreeNode The parent to look within.
predicate FuncBool The predicate used to match.
return ITreeNode

FirstRemainingParent() public method

Retrieves the first ancestor of a node that still exists as a descendent of the root node.
Useful for when a node is removed, and you want to move a view to the reamining parent.
public FirstRemainingParent ( ITreeNode root, ITreeNode orphan ) : ITreeNode
root ITreeNode The root node.
orphan ITreeNode The orphaned node.
return ITreeNode

FirstSelectedChild() public method

Retrieves the first selected child node.
public FirstSelectedChild ( ITreeNode parent ) : ITreeNode
parent ITreeNode The node to look within.
return ITreeNode

HasSelectedChild() public method

Determines whether at least one of the children of the given node are selected.
public HasSelectedChild ( ITreeNode parent ) : bool
parent ITreeNode The parent to examine.
return bool