Class StructureEditor<T>
An editor for hierarchical structures.
Implements
Namespace: NanoByte.StructureEditor.WinForms
Assembly: NanoByte.StructureEditor.WinForms.dll
Syntax
public class StructureEditor<T> : UserControl, IStructureEditor<T> where T : class, IEquatable<T>, new()
Type Parameters
Name | Description |
---|---|
T | The type of object to edit. |
Remarks
Derive and call DescribeRoot(String) or DescribeRoot<TEditor>(String) as well as Describe<TContainer>() in the constructor.
Constructors
StructureEditor()
Declaration
public StructureEditor()
Properties
CommandManager
Holds the object being editing and manages undo/redo operations on it.
Declaration
public ICommandManager<T> CommandManager { get; }
Property Value
Type | Description |
---|---|
ICommandManager<T> |
Methods
Describe<TContainer>()
Adds a ContainerDescription<TContainer> used to describe the structure of the data being editing.
Declaration
public IContainerDescription<TContainer> Describe<TContainer>()
where TContainer : class
Returns
Type | Description |
---|---|
IContainerDescription<TContainer> | The ContainerDescription<TContainer> for use in a "Fluent API" style. |
Type Parameters
Name | Description |
---|---|
TContainer | The type of the container to describe. |
DescribeRoot(String)
Set up handling for the root element with a generic editor.
Declaration
public IContainerDescription<T> DescribeRoot(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the root element. |
Returns
Type | Description |
---|---|
IContainerDescription<T> | The ContainerDescription<TContainer> for use in a "Fluent API" style. |
DescribeRoot<TEditor>(String)
Set up handling for the root element with a custom editor.
Declaration
public IContainerDescription<T> DescribeRoot<TEditor>(string name)
where TEditor : INodeEditor<T>, new()
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the root element. |
Returns
Type | Description |
---|---|
IContainerDescription<T> | The ContainerDescription<TContainer> for use in a "Fluent API" style. |
Type Parameters
Name | Description |
---|---|
TEditor | An editor for modifying the content of the root. |
GetSerialized()
Returns the serialized representation of the NanoByte.StructureEditor.WinForms.StructureEditor`1.SelectedNode.
Declaration
protected virtual string GetSerialized()
Returns
Type | Description |
---|---|
String |
Open(ICommandManager<T>)
Opens an object for editing using the specified ICommandManager<T>.
Declaration
public void Open(ICommandManager<T> commandManager)
Parameters
Type | Name | Description |
---|---|---|
ICommandManager<T> | commandManager | Holds the object being editing and manages undo/redo operations on it. |
Redo()
Redoes the last action.
Declaration
public void Redo()
Remove()
Removes the currently selected entry.
Declaration
public void Remove()
Undo()
Undoes the last action.
Declaration
public void Undo()