Class StructureTreeNode

Assembly: redb.Core.dll

Structure tree node for hierarchical navigation
Solves the problem of flat structure search in SaveAsync

public class StructureTreeNode

Inheritance

ObjectStructureTreeNode

Properties

Children

public List<StructureTreeNode> Children { get; set; }

Depth

public int Depth { get; }

IsLeaf

public bool IsLeaf { get; }

IsRoot

TREE NAVIGATION

public bool IsRoot { get; }

Parent

public StructureTreeNode? Parent { get; set; }

Path

public string Path { get; }

Structure

public IRedbStructure Structure { get; set; }

Methods

FindChild(string)

TREE SEARCH

public StructureTreeNode? FindChild(string name)

FindDescendant(long)

public StructureTreeNode? FindDescendant(long structureId)

FindDescendantByName(string)

public StructureTreeNode? FindDescendantByName(string name)

GetAllDescendants()

public List<StructureTreeNode> GetAllDescendants()

GetChildrenStructures()

public List<IRedbStructure> GetChildrenStructures()

GetLeafNodes()

public List<StructureTreeNode> GetLeafNodes()

HasChild(string)

HIERARCHY CHECKS

public bool HasChild(string name)

HasDescendant(long)

public bool HasDescendant(long structureId)

IsDescendantOf(StructureTreeNode)

public bool IsDescendantOf(StructureTreeNode ancestor)

PrintTree()

Print entire tree for diagnostics

public string PrintTree()

ToDetailedString()

public string ToDetailedString()

ToString()

DIAGNOSTICS

public override string ToString()

WalkTree(Action<StructureTreeNode>)

TREE TRAVERSAL

public void WalkTree(Action<StructureTreeNode> visitor)

WalkTreeWithDepth(Action<StructureTreeNode, int>, int)

public void WalkTreeWithDepth(Action<StructureTreeNode, int> visitor, int currentDepth = 0)