Class HierarchyElement
Hierarchical structure to store object
Inheritance
System.Object
HierarchyElement
Namespace: SigStat.Common.Helpers
Assembly: SigStat.Common.dll
Syntax
public class HierarchyElement : IEnumerable<HierarchyElement>
Constructors
| Improve this Doc View SourceHierarchyElement()
Create an emty element
Declaration
public HierarchyElement()
HierarchyElement(Object)
Create a new element with content
Declaration
public HierarchyElement(Object Content)
Parameters
Type | Name | Description |
---|---|---|
Object | Content | Content of the new element |
Properties
| Improve this Doc View SourceChildren
Gets the children.
Declaration
public List<HierarchyElement> Children { get; }
Property Value
Type | Description |
---|---|
List<HierarchyElement> |
Content
Gets or sets the content.
Declaration
public Object Content { get; set; }
Property Value
Type | Description |
---|---|
Object |
Methods
| Improve this Doc View SourceAdd(HierarchyElement)
Adds the specified element as a child
Declaration
public void Add(HierarchyElement child)
Parameters
Type | Name | Description |
---|---|---|
HierarchyElement | child |
GetCount()
Returns number of elements under this node and itself
Declaration
public int GetCount()
Returns
Type | Description |
---|---|
System.Int32 |
GetDepth()
Return the hierarchy's depth from this node
Declaration
public int GetDepth()
Returns
Type | Description |
---|---|
System.Int32 |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<HierarchyElement> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<HierarchyElement> |
ToString()
Converts to string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A |