Interface IHierarchy<T>
Provides a generic way to expose a node of a hierarchical structure, including the node object of type T
.
Inherited Members
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public interface IHierarchy<T> : IWrapper<T>, IData
Type Parameters
Name | Description |
---|---|
T | The type of the node represented in the hierarchical structure. |
Properties
| Improve this DocDepth
Gets the current depth of the node in the hierarchical structure.
Declaration
int Depth { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The current depth of the node in the hierarchical structure. |
HasChildren
Indicates whether the current node has any child nodes.
Declaration
bool HasChildren { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
HasParent
Indicates whether the current node has a parent node.
Declaration
bool HasParent { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Index
Gets the zero-based index of the current node that this hierarchical structure represents.
Declaration
int Index { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The zero-based index of the current node that this hierarchical structure represents. |
Item[Int32]
Gets the node at the specified index.
Declaration
IHierarchy<T> this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type | Description |
---|---|
IHierarchy<T> | The node at the specified index. |
Methods
| Improve this DocAdd(T)
Adds the specified instance to a node in the hierarchical structure representation.
Declaration
IHierarchy<T> Add(T instance)
Parameters
Type | Name | Description |
---|---|---|
T | instance | The instance to a node in the hierarchical structure represents. |
Returns
Type | Description |
---|---|
IHierarchy<T> | A reference to the newly added hierarchical node. |
Add(T, MemberInfo)
Adds the specified instance to a node in the hierarchical structure representation.
Declaration
IHierarchy<T> Add(T instance, MemberInfo member)
Parameters
Type | Name | Description |
---|---|---|
T | instance | The instance to a node in the hierarchical structure represents. |
System.Reflection.MemberInfo | member | The member from where |
Returns
Type | Description |
---|---|
IHierarchy<T> | A reference to the newly added hierarchical node. |
GetChildren()
Gets an System.Collections.Generic.IEnumerable<T> sequence that represents all the child nodes of the current hierarchical node.
Declaration
IEnumerable<IHierarchy<T>> GetChildren()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IHierarchy<T>> | An System.Collections.Generic.IEnumerable<T> sequence that represents all the child nodes of the current hierarchical node. |
GetParent()
Gets the parent node of the current node in the hierarchical structure.
Declaration
IHierarchy<T> GetParent()
Returns
Type | Description |
---|---|
IHierarchy<T> | The parent node of the current node in the hierarchical structure. |
GetPath()
Gets the hierarchical path of the node in the hierarchical structure.
Declaration
string GetPath()
Returns
Type | Description |
---|---|
System.String | A System.String that identifies the hierarchical path relative to the current node. |
GetPath(Func<IHierarchy<T>, String>)
Gets the hierarchical path of the node in the hierarchical structure.
Declaration
string GetPath(Func<IHierarchy<T>, string> pathResolver)
Parameters
Type | Name | Description |
---|---|---|
System.Func<IHierarchy<T>, System.String> | pathResolver | The function delegate that resolves the hierarchical path of the node in the hierarchical structure. |
Returns
Type | Description |
---|---|
System.String | A System.String that identifies the hierarchical path relative to the current node. |
Replace(T)
Allows for the instance on the current node to be replaced with a new instance
.
Declaration
void Replace(T instance)
Parameters
Type | Name | Description |
---|---|---|
T | instance | The new instance to replace the original with. |