Class PropertyElementNode<TContainer, TProperty, TElement, TEditor>
- Namespace
- NanoByte.StructureEditor
- Assembly
- NanoByte.StructureEditor.dll
Describes a node in the structure that points to a specific type of value of a polymorphic single-value property.
public class PropertyElementNode<TContainer, TProperty, TElement, TEditor> : Node where TContainer : class where TProperty : class where TElement : class, TProperty where TEditor : INodeEditor<TElement>, new()
Type Parameters
TContainerThe type of the container containing the property.
TPropertyThe base type of the property.
TElementThe specific type the property value currently has.
TEditorAn editor for modifying the content of the value.
- Inheritance
-
objectPropertyElementNode<TContainer, TProperty, TElement, TEditor>
- Inherited Members
Constructors
PropertyElementNode(string, TContainer, PropertyPointer<TProperty?>, TElement, bool)
Describes a node in the structure that points to a specific type of value of a polymorphic single-value property.
public PropertyElementNode(string name, TContainer container, PropertyPointer<TProperty?> pointer, TElement element, bool nullable = true)
Parameters
namestringThe name of the value type.
containerTContainerThe container containing the property.
pointerPropertyPointer<TProperty>A pointer to the property.
elementTElementThe current value of the property.
nullableboolWhether 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
executorICommandExecutorUsed to perform undo/redo operations.
Returns
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
GetSerialized()
Returns a serialized representation of the Target.
public override string GetSerialized()
Returns
GetUpdateCommand(string)
Gets a command for updating the node's target with a new value.
public override IValueCommand? GetUpdateCommand(string serializedValue)
Parameters
serializedValuestringA serialized representation of the new value.