Click or drag to resize

TreeNodeExtensionsTakeFromLastLeavesToHereT, D(T, D, Boolean, FuncT, D, D) Method

Enumerates through all tree nodes from the downmost leaf of the tree down to the provided node node. Local data is provided for each enumerated node. The local data is calculated from the root node up to the enumerated node. If includeThisNode is true, the provided node node is included in the enumeration. Attention: Since the order of the nodes must be reversed, this enumeration is only efficient for ITreeListNodeT types.

Namespace: Altaxo.Collections
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public static IEnumerable<Tuple<T, D>> TakeFromLastLeavesToHere<T, D>(
	this T node,
	D nodesLocalData,
	bool includeThisNode,
	Func<T, D, D> transformLocalDataFromParentToChild
)
where T : Object, ITreeNode<T>

Parameters

node  T
The node from which to start visiting the tree.
nodesLocalData  D
Local data belonging to the provided node.
includeThisNode  Boolean
If set to true the node node is included in action execution, otherwise, it is not part of the action execution.
transformLocalDataFromParentToChild  FuncT, D, D
When traversing the tree from the root node up to the leaves, the provided local data can be transformed so that the data always reflect the state of the nodes. First argument is the child node, second argument is the local data from the parent node. The return value should be the local data for the child node given in the first argument.

Type Parameters

T
Type of node
D
Type of some data that is associated with a node (the node's local data).

Return Value

IEnumerableTupleT, D
All tree nodes from the downmost leaf of the tree down to the provided node node.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type T. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also