Table of Contents

Class PropertyNode<TContainer, TProperty, TEditor>

Namespace
NanoByte.StructureEditor
Assembly
NanoByte.StructureEditor.dll

Describes a node in the structure that points to a property.

public class PropertyNode<TContainer, TProperty, TEditor> : Node where TContainer : class where TProperty : class where TEditor : INodeEditor<TProperty>, new()

Type Parameters

TContainer

The type of the container containing the property.

TProperty

The type of the property.

TEditor

An editor for modifying the content of the property.

Inheritance
object
PropertyNode<TContainer, TProperty, TEditor>
Inherited Members

Constructors

PropertyNode(string, TContainer, PropertyPointer<TProperty?>, bool)

Describes a node in the structure that points to a property.

public PropertyNode(string name, TContainer container, PropertyPointer<TProperty?> pointer, bool nullable = true)

Parameters

name string

The name of the property.

container TContainer

The container containing the property.

pointer PropertyPointer<TProperty>

A pointer to the property.

nullable bool

Whether the property may be set to null, i.e. removed.

Methods

GetEditorControl(ICommandExecutor)

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

public override 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 override IUndoCommand? GetRemoveCommand()

Returns

IUndoCommand

GetSerialized(IStructureSerializer)

Returns a serialized representation of the Target.

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