Table of Contents

Class NodeEditorBase<T>

Namespace
NanoByte.StructureEditor.WinForms
Assembly
NanoByte.StructureEditor.WinForms.dll

Common base class for controls that edits a node in the structure.

public abstract class NodeEditorBase<T> : UserControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl, INodeEditor<T>, INodeEditor where T : class

Type Parameters

T

The type of element to edit.

Inheritance
NodeEditorBase<T>
Implements
Derived
Inherited Members

Constructors

NodeEditorBase()

protected NodeEditorBase()

Properties

CommandExecutor

An optional undo system to use for editing.

[Browsable(false)]
public virtual ICommandExecutor? CommandExecutor { get; set; }

Property Value

ICommandExecutor

Target

The element to be edited.

[Browsable(false)]
public virtual T? Target { get; set; }

Property Value

T

Methods

Bind(UriTextBox, PropertyPointer<Uri?>)

Binds a UriTextBox to an Uri property through the live editing and Undo system.

protected void Bind(UriTextBox control, PropertyPointer<Uri?> pointer)

Parameters

control UriTextBox

The control to hook up (is automatically added to Controls).

pointer PropertyPointer<Uri>

Read/write access to the value the control represents.

Bind(CheckBox, PropertyPointer<bool>)

Binds a CheckBox to a bool property through the live editing and Undo system.

protected void Bind(CheckBox control, PropertyPointer<bool> pointer)

Parameters

control CheckBox

The control to hook up (is automatically added to Controls).

pointer PropertyPointer<bool>

Read/write access to the value the control represents.

Bind(ComboBox, PropertyPointer<string?>)

Binds a ComboBox to a string property through the live editing and Undo system.

protected void Bind(ComboBox control, PropertyPointer<string?> pointer)

Parameters

control ComboBox

The control to hook up (is automatically added to Controls).

pointer PropertyPointer<string>

Read/write access to the value the control represents.

Bind(Control, PropertyPointer<string?>)

Binds a WinForms control to a property through the live editing and Undo system.

protected void Bind(Control control, PropertyPointer<string?> pointer)

Parameters

control Control

The control to hook up (is automatically added to Controls).

pointer PropertyPointer<string>

Read/write access to the value the control represents.

Bind<TControl, TChild>(TControl, Func<TChild>)

Binds a INodeEditor<T> as child editor through the live editing and Undo system.

protected void Bind<TControl, TChild>(TControl control, Func<TChild> getTarget) where TControl : Control, INodeEditor<TChild> where TChild : class

Parameters

control TControl

The control to hook up (is automatically added to Controls).

getTarget Func<TChild>

Callback to retrieve the (child) target of the control.

Type Parameters

TControl

The specific INodeEditor<T> type.

TChild

The type the child editor handles.

Refresh()

Forces the control to invalidate its client area and immediately redraw itself and any child controls.

public override void Refresh()

Events

CommandExecutorChanged

Is raised when CommandExecutor has been changed.

protected event Action? CommandExecutorChanged

Event Type

Action

OnRefresh

Is raised when Refresh() is called.

protected event Action? OnRefresh

Event Type

Action

TargetChanged

Is raised when Target has been changed.

protected event Action? TargetChanged

Event Type

Action