Class Node
Describes a specific node in the structure.
Inheritance
Node
Namespace: NanoByte.StructureEditor
Assembly: NanoByte.StructureEditor.dll
Syntax
public abstract class Node : Object
Constructors
Node(String, String, Object)
Creates a new node.
Declaration
protected Node(string nodeType, string description, object target)
Parameters
Type | Name | Description |
---|---|---|
String | nodeType | The name of the node type. |
String | description | A description of the node type. |
Object | target | The object the node represents. |
Properties
Description
A description of the node type.
Declaration
public string Description { get; }
Property Value
Type | Description |
---|---|
String |
NodeType
The name of the node type.
Declaration
public string NodeType { get; }
Property Value
Type | Description |
---|---|
String |
Target
The object the node represents.
Declaration
public object Target { get; }
Property Value
Type | Description |
---|---|
Object |
Methods
GetDescription<T>()
Gets the Description of T
, if any.
Declaration
public static string GetDescription<T>()
Returns
Type | Description |
---|---|
String |
Type Parameters
Name | Description |
---|---|
T |
GetEditorControl(ICommandExecutor)
Gets a GUI control for editing the node's target.
Declaration
public abstract INodeEditor GetEditorControl(ICommandExecutor executor)
Parameters
Type | Name | Description |
---|---|---|
ICommandExecutor | executor | Used to perform undo/redo operations. |
Returns
Type | Description |
---|---|
INodeEditor |
GetRemoveCommand()
Gets a command for removing the node's target from the structure.
Declaration
public abstract IUndoCommand GetRemoveCommand()
Returns
Type | Description |
---|---|
IUndoCommand |
GetSerialized()
Returns a serialized representation of the Target.
Declaration
public abstract string GetSerialized()
Returns
Type | Description |
---|---|
String |
GetUpdateCommand(String)
Gets a command for updating the node's target with a new value.
Declaration
public abstract IValueCommand GetUpdateCommand(string serializedValue)
Parameters
Type | Name | Description |
---|---|---|
String | serializedValue | A serialized representation of the new value. |
Returns
Type | Description |
---|---|
IValueCommand |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |