ItemTreeBuildExtensionsBuildTNode, TItem(TNode, FuncTNode, IEnumerableTItem, NullableInt32) Method

Build tree from parent/root node. Uses function to retrieve child items.

Definition

Namespace: MobileTrack.Common.Models.TreeViews.ItemTree
Assembly: MobileTrack.Common (in MobileTrack.Common.dll) Version: 0.7+45c8d9adb5970d727cceec44a5ed61aea0016e50
public static void Build<TNode, TItem>(
	this TNode parent,
	Func<TNode, IEnumerable<TItem>> getChildItems,
	int? maxRelativeDepth = null
)
where TNode : ItemTreeNode<TNode, TItem>
where TItem : IIdLabel

Parameters

parent  TNode
Parent/root destination node
getChildItems  FuncTNode, IEnumerableTItem
Function to retrieve child items
maxRelativeDepth  NullableInt32  (Optional)
Max depth of traversal (relative to this node)

Type Parameters

TNode
Node type
TItem
Business object type in the collection, derived from IIdLabel

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type TNode. 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