Table of Contents

Class NTreeHtml<T>

Namespace
SunamoHtml._public.SunamoData.Data
Assembly
SunamoHtml.dll

EN: Generic N-ary tree structure for HTML nodes. CZ: Obecná N-ární stromová struktura pro HTML uzly.

public class NTreeHtml<T>

Type Parameters

T

The type of data stored in each node.

Inheritance
NTreeHtml<T>
Inherited Members
Extension Methods

Constructors

NTreeHtml(T)

Initializes a new instance of the NTreeHtml class with specified data.

public NTreeHtml(T data)

Parameters

data T

The data to store in this node.

Properties

Children

EN: Gets the child nodes of this node. CZ: Získá podřízené uzly tohoto uzlu.

public LinkedList<NTreeHtml<T>> Children { get; }

Property Value

LinkedList<NTreeHtml<T>>

Data

EN: Gets or sets the data stored in this node. CZ: Získá nebo nastaví data uložená v tomto uzlu.

public T Data { get; set; }

Property Value

T

Methods

AddChild(T)

EN: Adds a new child node with specified data to the beginning of the children list. CZ: Přidá nový podřízený uzel se zadanými daty na začátek seznamu dětí.

public NTreeHtml<T> AddChild(T data)

Parameters

data T

The data for the new child node.

Returns

NTreeHtml<T>

The newly created child node.

GetChild(int)

EN: Gets the child node at the specified index. CZ: Získá podřízený uzel na zadaném indexu.

public NTreeHtml<T>? GetChild(int index)

Parameters

index int

The zero-based index of the child to retrieve.

Returns

NTreeHtml<T>

The child node at the specified index, or null if not found.

Traverse(NTreeHtml<T>, Action<T>)

EN: Traverses the tree starting from the specified node, calling the visitor action for each node. CZ: Projde strom od zadaného uzlu, zavolá akci visitor pro každý uzel.

public void Traverse(NTreeHtml<T> node, Action<T> visitor)

Parameters

node NTreeHtml<T>

The root node to start traversal from.

visitor Action<T>

The action to call for each node's data.