ILogicalTreeNodeExtensions Class
Provides extension methods for the type ILogicalTreeNode
public static class ILogicalTreeNodeExtensions
- Inheritance:
- object object
Methods
FindCommonLogicalAncestor(ILogicalTreeNode?, ILogicalTreeNode?)
Tries to find the closest ancestor in the logical tree that is common between two objects.
public static ILogicalTreeNode? FindCommonLogicalAncestor(this ILogicalTreeNode? logical, ILogicalTreeNode? target)
| Parameter | Type | Description |
|---|---|---|
| logical | ILogicalTreeNode | The first object to examine. |
| target | ILogicalTreeNode | The second object to examine. |
Returns
- ILogicalTreeNode:
The closest ancestor in the logical tree that is common between two objects.
See Also
FindLogicalAncestorOfType<T>(ILogicalTreeNode?, bool)
Finds the first ancestor of the given type in the logical tree.
public static T? FindLogicalAncestorOfType<T>(this ILogicalTreeNode? logical, bool includeSelf = false) where T : class
- Type Parameters:
-
T-The type of ancestor to find.
| Parameter | Type | Description |
|---|---|---|
| logical | ILogicalTreeNode | The object to examine. |
| includeSelf | bool | Indicates if the given object should be included in the search. |
Returns
- T:
The first ancestor of the given type, or
nullif a match was not found.
See Also
FindLogicalDescendantOfType<T>(ILogicalTreeNode?, bool)
Finds the first descendant of the given type in the logical tree.
public static T? FindLogicalDescendantOfType<T>(this ILogicalTreeNode? logical, bool includeSelf = false) where T : class
- Type Parameters:
-
T-The type of descendant to find.
| Parameter | Type | Description |
|---|---|---|
| logical | ILogicalTreeNode | The object to examine. |
| includeSelf | bool | Indicates if the given object should be included in the search. |
Returns
- T:
The first descendant of the given type, or
nullif a match was not found.
See Also
GetLogicalAncestors(ILogicalTreeNode)
Enumerates the ancestors of an object in the logical tree.
public static IEnumerable<ILogicalTreeNode> GetLogicalAncestors(this ILogicalTreeNode logical)
| Parameter | Type | Description |
|---|---|---|
| logical | ILogicalTreeNode | The object to examine. |
Returns
See Also
GetLogicalChildren(ILogicalTreeNode)
Enumerates the children of an object in the logical tree.
public static IEnumerable<ILogicalTreeNode> GetLogicalChildren(this ILogicalTreeNode logical)
| Parameter | Type | Description |
|---|---|---|
| logical | ILogicalTreeNode | The object to examine. |
Returns
See Also
GetLogicalDescendants(ILogicalTreeNode)
Enumerates the descendants of an object in the logical tree.
public static IEnumerable<ILogicalTreeNode> GetLogicalDescendants(this ILogicalTreeNode logical)
| Parameter | Type | Description |
|---|---|---|
| logical | ILogicalTreeNode | The object to examine. |
Returns
See Also
GetLogicalParent(ILogicalTreeNode)
Returns the parent of an object in the logical tree.
public static ILogicalTreeNode? GetLogicalParent(this ILogicalTreeNode logical)
| Parameter | Type | Description |
|---|---|---|
| logical | ILogicalTreeNode | The object to examine. |
Returns
- ILogicalTreeNode:
The parent, or
nullif the object does not have a parent.
See Also
GetLogicalParent<T>(ILogicalTreeNode)
Returns the parent of an object in the logical tree.
public static T? GetLogicalParent<T>(this ILogicalTreeNode logical) where T : class
- Type Parameters:
-
T-The type of the logical parent.
| Parameter | Type | Description |
|---|---|---|
| logical | ILogicalTreeNode | The object to examine. |
Returns
- T:
The parent, or
nullif the object does not have a parent or its parent is not of the typeT.
See Also
GetLogicalSiblings(ILogicalTreeNode)
Enumerates the siblings of an object in the logical tree.
public static IEnumerable<ILogicalTreeNode> GetLogicalSiblings(this ILogicalTreeNode logical)
| Parameter | Type | Description |
|---|---|---|
| logical | ILogicalTreeNode | The object to examine. |
Returns
See Also
GetSelfAndLogicalAncestors(ILogicalTreeNode)
Enumerates an object and its ancestors in the logical tree.
public static IEnumerable<ILogicalTreeNode> GetSelfAndLogicalAncestors(this ILogicalTreeNode logical)
| Parameter | Type | Description |
|---|---|---|
| logical | ILogicalTreeNode | The object to examine. |
Returns
See Also
GetSelfAndLogicalDescendants(ILogicalTreeNode)
Enumerates an object and its descendants in the logical tree.
public static IEnumerable<ILogicalTreeNode> GetSelfAndLogicalDescendants(this ILogicalTreeNode logical)
| Parameter | Type | Description |
|---|---|---|
| logical | ILogicalTreeNode | The object to examine. |
Returns
See Also
IsLogicalAncestorOf(ILogicalTreeNode?, ILogicalTreeNode?)
Tests whether an object is an ancestor of another object in the logical tree.
public static bool IsLogicalAncestorOf(this ILogicalTreeNode? logical, ILogicalTreeNode? target)
| Parameter | Type | Description |
|---|---|---|
| logical | ILogicalTreeNode | The object to examine. |
| target | ILogicalTreeNode | The potential descendant. |
Returns
- bool:
trueif the object is an ancestor oftarget; otherwise,false.
See Also
Inherited Members
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()