Show / Hide Table of Contents

Class Hierarchy<T>

Represents a way to expose a node of a hierarchical structure, including the node object of type T.

Inheritance
Object
Wrapper<T>
Hierarchy<T>
Implements
IHierarchy<T>
IWrapper<T>
IData
Inherited Members
Wrapper<T>.Instance
Wrapper<T>.InstanceType
Wrapper<T>.MemberReference
Wrapper<T>.HasMemberReference
Wrapper<T>.Data
Wrapper<T>.InstanceAs<TResult>()
Wrapper<T>.InstanceAs<TResult>(IFormatProvider)
Wrapper<T>.ToString()
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public sealed class Hierarchy<T> : Wrapper<T>, IHierarchy<T>, IWrapper<T>, IData
Type Parameters
Name Description
T

The type of the object represented in the hierarchical structure.

Constructors

| Improve this Doc View Source

Hierarchy()

Initializes a new instance of the Hierarchy<T> class.

Declaration
public Hierarchy()

Properties

| Improve this Doc View Source

Depth

Gets the current depth of the node in the hierarchical structure.

Declaration
public int Depth { get; }
Property Value
Type Description
Int32

The current depth of the in the hierarchical structure.

| Improve this Doc View Source

HasChildren

Gets a value indicating whether this instance has any children.

Declaration
public bool HasChildren { get; }
Property Value
Type Description
Boolean

true if this instance has any children; otherwise, false.

| Improve this Doc View Source

HasParent

Gets a value indicating whether this instance has a parent.

Declaration
public bool HasParent { get; }
Property Value
Type Description
Boolean

true if this instance has a parent; otherwise, false.

| Improve this Doc View Source

Index

Gets the zero-based index of the current node that this hierarchical structure represents.

Declaration
public int Index { get; }
Property Value
Type Description
Int32

The zero-based index of the current node that this hierarchical structure represents.

| Improve this Doc View Source

Item[Int32]

Gets the node at the specified index.

Declaration
public IHierarchy<T> this[int index] { get; }
Parameters
Type Name Description
Int32 index
Property Value
Type Description
IHierarchy<T>

The node at the specified index.

Methods

| Improve this Doc View Source

Add(T)

Adds the specified instance to a node in the hierarchical structure representation.

Declaration
public 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.

| Improve this Doc View Source

Add(T, MemberInfo)

Adds the specified instance to a node in the hierarchical structure representation.

Declaration
public IHierarchy<T> Add(T instance, MemberInfo member)
Parameters
Type Name Description
T instance

The instance to a node in the hierarchical structure represents.

MemberInfo member

The member from where instance was referenced.

Returns
Type Description
IHierarchy<T>

A reference to the newly added hierarchical node.

| Improve this Doc View Source

Add(T, Type)

Adds the specified instance to a node in the hierarchical structure representation.

Declaration
public IHierarchy<T> Add(T instance, Type instanceType)
Parameters
Type Name Description
T instance

The instance to a node in the hierarchical structure represents.

Type instanceType

The type of instance.

Returns
Type Description
IHierarchy<T>

A reference to the newly added hierarchical node.

Exceptions
Type Condition
ArgumentNullException

instanceType is null.

| Improve this Doc View Source

Add(T, Type, MemberInfo)

Adds the specified instance to a node in the hierarchical structure representation.

Declaration
public IHierarchy<T> Add(T instance, Type instanceType, MemberInfo member)
Parameters
Type Name Description
T instance

The instance to a node in the hierarchical structure represents.

Type instanceType

The type of instance.

MemberInfo member

The member from where instance was referenced.

Returns
Type Description
IHierarchy<T>

A reference to the newly added hierarchical node.

Exceptions
Type Condition
ArgumentNullException

instanceType is null.

| Improve this Doc View Source

GetChildren()

Gets an IEnumerable<T> sequence that represents all the child nodes of the current hierarchical node.

Declaration
public IEnumerable<IHierarchy<T>> GetChildren()
Returns
Type Description
IEnumerable<IHierarchy<T>>

An IEnumerable<T> sequence that represents all the child nodes of the current hierarchical node.

| Improve this Doc View Source

GetParent()

Gets the parent node of the current node in the hierarchical structure.

Declaration
public IHierarchy<T> GetParent()
Returns
Type Description
IHierarchy<T>

The parent node of the current node in the hierarchical structure.

| Improve this Doc View Source

GetPath()

Gets the hierarchical path of the node in the hierarchical structure.

Declaration
public string GetPath()
Returns
Type Description
String

A String that identifies the hierarchical path relative to the current node.

| Improve this Doc View Source

GetPath(Func<IHierarchy<T>, String>)

Gets the hierarchical path of the node in the hierarchical structure.

Declaration
public string GetPath(Func<IHierarchy<T>, string> pathResolver)
Parameters
Type Name Description
Func<IHierarchy<T>, String> pathResolver

The function delegate path resolver.

Returns
Type Description
String

A String that identifies the hierarchical path relative to the current node.

| Improve this Doc View Source

Replace(T)

Allows for the instance on the current node to be replaced with a new instance.

Declaration
public void Replace(T instance)
Parameters
Type Name Description
T instance

The new instance to replace the original with.

| Improve this Doc View Source

Replace(T, Type)

Allows for the instance on the current node to be replaced with a new instance.

Declaration
public void Replace(T instance, Type instanceType)
Parameters
Type Name Description
T instance

The new instance to replace the original with.

Type instanceType

The type of the new instance.

Implements

IHierarchy<T>
IWrapper<T>
IData
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright 2008-2022 Geekle. All rights reserved. Code with passion and love; deploy with confidence. 👨‍💻️🔥❤️🚀😎
Generated by DocFX