Table of Contents

Class NodeEditorBase<T>

Namespace
NanoByte.StructureEditor.EtoForms
Assembly
NanoByte.StructureEditor.EtoForms.dll

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

public abstract class NodeEditorBase<T> : Panel, IHandlerSource, IDisposable, IBindable, IMouseInputSource, IKeyboardInputSource, ICallbackSource, IBindableWidgetContainer, INodeEditor<T>, INodeEditor, IPendingChanges where T : class

Type Parameters

T

The type of element to edit.

Inheritance
object
Widget
BindableWidget
Control
Container
Panel
NodeEditorBase<T>
Implements
IHandlerSource
IBindable
IMouseInputSource
IKeyboardInputSource
ICallbackSource
IBindableWidgetContainer
Derived
Inherited Members
Panel.Remove(Control)
Panel.Controls
Panel.Padding
Panel.MinimumSize
Panel.ContextMenu
Panel.Content
Container.RemoveAll()
Container.RemoveParent(Control)
Container.SetLogicalParent(Control)
Container.RemoveLogicalParent(Control)
Container.ClientSize
Container.Children
Container.VisualChildren
Container.StyleProvider
Container.Styles
Control.SizeChangedEvent
Control.KeyDownEvent
Control.KeyUpEvent
Control.TextInputEvent
Control.MouseDownEvent
Control.MouseUpEvent
Control.MouseMoveEvent
Control.MouseLeaveEvent
Control.MouseEnterEvent
Control.MouseDoubleClickEvent
Control.MouseWheelEvent
Control.GotFocusEvent
Control.LostFocusEvent
Control.ShownEvent
Control.ThemeChangedEvent
Control.DragDropEvent
Control.DragOverEvent
Control.DragEnterEvent
Control.DragLeaveEvent
Control.DragEndEvent
Control.EnabledChangedEvent
Control.OnKeyDown(KeyEventArgs)
Control.OnKeyUp(KeyEventArgs)
Control.OnTextInput(TextInputEventArgs)
Control.OnMouseDown(MouseEventArgs)
Control.OnMouseUp(MouseEventArgs)
Control.OnMouseMove(MouseEventArgs)
Control.OnMouseLeave(MouseEventArgs)
Control.OnMouseEnter(MouseEventArgs)
Control.OnMouseDoubleClick(MouseEventArgs)
Control.OnMouseWheel(MouseEventArgs)
Control.OnDragDrop(DragEventArgs)
Control.OnDragOver(DragEventArgs)
Control.OnDragEnter(DragEventArgs)
Control.OnDragLeave(DragEventArgs)
Control.OnDragEnd(DragEventArgs)
Control.Invalidate()
Control.Invalidate(Rectangle)
Control.UpdateLayout()
Control.GetPreferredSize()
Control.GetPreferredSize(SizeF)
Control.CaptureMouse()
Control.ReleaseMouseCapture()
Control.Detach()
Control.AttachNative()
Control.DetachNative()
Control.Focus()
Control.SuspendLayout()
Control.ResumeLayout()
Control.PointFromScreen(PointF)
Control.PointToScreen(PointF)
Control.RectangleToScreen(RectangleF)
Control.RectangleFromScreen(RectangleF)
Control.DoDragDrop(DataObject, DragEffects)
Control.DoDragDrop(DataObject, DragEffects, Image, PointF)
Control.TriggerStyleChanged()
Control.OnApplyCascadingStyles()
Control.Print()
Control.GetCallback()
Control.IsDesignMode
Control.Handler
Control.Gestures
Control.Loaded
Control.VisualControls
Control.Tag
Control.LogicalParent
Control.IsVisualControl
Control.Size
Control.IsMouseCaptured
Control.Width
Control.Height
Control.Enabled
Control.Visible
Control.Parent
Control.VisualParent
Control.IsAttached
Control.BackgroundColor
Control.HasFocus
Control.IsSuspended
Control.ParentWindow
Control.SupportedPlatformCommands
Control.Bounds
Control.Location
Control.Cursor
Control.ToolTip
Control.TabIndex
Control.TabStop
Control.AllowDrop
Control.SizeChanged
Control.KeyDown
Control.KeyUp
Control.TextInput
Control.MouseDown
Control.MouseUp
Control.MouseMove
Control.MouseLeave
Control.MouseEnter
Control.MouseDoubleClick
Control.MouseWheel
Control.GotFocus
Control.LostFocus
Control.Shown
Control.ThemeChanged
Control.PreLoad
Control.Load
Control.LoadComplete
Control.UnLoad
Control.DragDrop
Control.DragOver
Control.DragEnter
Control.DragLeave
Control.DragEnd
Control.EnabledChanged
BindableWidget.Unbind()
BindableWidget.UpdateBindings(BindingUpdateMode)
BindableWidget.Parents
BindableWidget.DataContext
BindableWidget.Bindings
BindableWidget.IsDataContextChanging
BindableWidget.DataContextChanged
Widget.Initialize()
Widget.Dispose()
Widget.ToString()
Widget.Platform
Widget.NativeHandle
Widget.Properties
Widget.ID
Widget.Style
Widget.ControlObject
Widget.IsDisposed
Widget.StyleChanged

Remarks

Use the Bind() methods to connect controls to properties of the Target and then place them in a layout assigned to Eto.Forms.Panel.Content.

Constructors

NodeEditorBase()

protected NodeEditorBase()

Properties

CommandExecutor

An optional undo system to use for editing.

public virtual ICommandExecutor? CommandExecutor { get; set; }

Property Value

ICommandExecutor

Target

The element to be edited.

public virtual T? Target { get; set; }

Property Value

T

Methods

Bind(CheckBox, PropertyPointer<bool>)

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

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

Parameters

control CheckBox

The control to hook up.

pointer PropertyPointer<bool>

Read/write access to the value the control represents.

Returns

CheckBox

The control, for placing in a layout.

Bind(ComboBox, PropertyPointer<string?>)

Binds an editable Eto.Forms.ComboBox to a string property through the live editing and Undo system.

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

Parameters

control ComboBox

The control to hook up.

pointer PropertyPointer<string>

Read/write access to the value the control represents.

Returns

ComboBox

The control, for placing in a layout.

Bind(UriTextBox, PropertyPointer<Uri?>)

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

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

Parameters

control UriTextBox

The control to hook up.

pointer PropertyPointer<Uri>

Read/write access to the value the control represents.

Returns

UriTextBox

The control, for placing in a layout.

Bind<TControl>(TControl, PropertyPointer<string?>)

Binds a text control (e.g., a Eto.Forms.TextBox or Eto.Forms.TextArea) to a string property through the live editing and Undo system.

protected TControl Bind<TControl>(TControl control, PropertyPointer<string?> pointer) where TControl : TextControl

Parameters

control TControl

The control to hook up.

pointer PropertyPointer<string>

Read/write access to the value the control represents.

Returns

TControl

The control, for placing in a layout.

Type Parameters

TControl

Remarks

Input is applied when the control loses focus, when Enter is pressed in a single-line control and when CommitPendingChanges() is called.

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

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

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

Parameters

control TControl

The control to hook up.

getTarget Func<TChild>

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

Returns

TControl

The control, for placing in a layout.

Type Parameters

TControl

The specific INodeEditor<T> type.

TChild

The type the child editor handles.

CommitPendingChanges()

Applies any user input that has not been applied yet.

public virtual void CommitPendingChanges()

Remarks

Call this before relying on the data being edited to be up-to-date, e.g., before saving.

Refresh()

Updates the control to reflect the current state of the node being edited, e.g., after it was modified externally.

public virtual void Refresh()

SetValue<TValue>(PropertyPointer<TValue>, TValue)

Sets a new value through the Undo system, if available.

protected void SetValue<TValue>(PropertyPointer<TValue> pointer, TValue value)

Parameters

pointer PropertyPointer<TValue>

Read/write access to the value.

value TValue

The new value.

Type Parameters

TValue

Events

CommandExecutorChanged

Is raised when CommandExecutor has been changed.

protected event Action? CommandExecutorChanged

Event Type

Action

OnCommitPendingChanges

Is raised when CommitPendingChanges() is called.

protected event Action? OnCommitPendingChanges

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