Table of Contents

Class Node

Namespace
NanoByte.StructureEditor
Assembly
NanoByte.StructureEditor.dll

Describes a specific node in the structure.

public abstract class Node
Inheritance
object
Node
Derived

Constructors

Node(string, string?, object?)

Describes a specific node in the structure.

protected Node(string nodeType, string? description, object? target)

Parameters

nodeType string

The name of the node type.

description string

A description of the node type.

target object

The object the node represents.

Properties

Description

A description of the node type.

public string? Description { get; }

Property Value

string

NodeType

The name of the node type.

public string NodeType { get; }

Property Value

string

Target

The object the node represents.

public object? Target { get; }

Property Value

object

Methods

GetDescription<T>()

Gets the Description of T, if any.

public static string? GetDescription<T>()

Returns

string

Type Parameters

T

GetEditorControl(ICommandExecutor)

Gets a GUI control for editing the node's target.

public abstract INodeEditor GetEditorControl(ICommandExecutor executor)

Parameters

executor ICommandExecutor

Used to perform undo/redo operations.

Returns

INodeEditor

GetRemoveCommand()

Gets a command for removing the node's target from the structure; null if the node cannot be removed.

public abstract IUndoCommand? GetRemoveCommand()

Returns

IUndoCommand

GetSerialized(IStructureSerializer)

Returns a serialized representation of the Target.

public abstract string GetSerialized(IStructureSerializer serializer)

Parameters

serializer IStructureSerializer

The serializer to use.

Returns

string

GetUpdateCommand(string, IStructureSerializer)

Gets a command for updating the node's target with a new value.

public abstract IValueCommand? GetUpdateCommand(string serializedValue, IStructureSerializer serializer)

Parameters

serializedValue string

A serialized representation of the new value.

serializer IStructureSerializer

The serializer to use.

Returns

IValueCommand

The command; null if the new value is equivalent to the current one.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.