Click or drag to resize

imbGraphExtensionsgetParentOrRoot Method

imbSCI | imbACE | imbNLP | imbWEM | imbWBI
Gets a member from parent-chain: a) Nth parent according to limit. b) parent on targetPath, c) parent of target type or simply d) root if no more parents.

Namespace:  imbSCI.Data
Assembly:  imbSCI.Data (in imbSCI.Data.dll) Version: 0.3.70.
Syntax
C#
public static IObjectWithParent getParentOrRoot(
	this IObjectWithParent source,
	string targetPath = "",
	Type target = null,
	int limit = 100
)
Request Example View Source

Parameters

source
Type: imbSCI.Data.interfacesIObjectWithParent
The source - objects to start search from
targetPath (Optional)
Type: SystemString
Once head reach this path it will trigger return of head. Disabled if empty or null.
target (Optional)
Type: SystemType
The target Type - what type will triger return of current head
limit (Optional)
Type: SystemInt32
The limit of depth. For -1: unlimited, For 1: it will return source.parent, For 0: it will return source, for 50: it will return 50th parent in parent-chain.

Return Value

Type: IObjectWithParent
Parent in parent chain or root

Usage Note

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