Table of Contents

Interface ITextEditor

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

A control for editing the serialized text representation of a node in the structure.

public interface ITextEditor

Remarks

Implement this to plug in a more capable text editor (e.g., with syntax highlighting) via TextEditorFactory.

Properties

Control

The control to display.

Control Control { get; }

Property Value

Control

Text

The text currently in the editor.

string Text { get; }

Property Value

string

Methods

ClearError()

Removes any marker set by ShowError(int, int, string).

void ClearError()

NavigateTo(int, int)

Moves the caret to a location in the text and gives the editor the input focus.

void NavigateTo(int line, int column)

Parameters

line int

The 1-based line number.

column int

The 1-based column number.

SetContent(string, string)

Replaces the text in the editor.

void SetContent(string text, string formatName)

Parameters

text string

The new text.

formatName string

The FormatName of the text (e.g., XML or JSON). May be used to determine syntax highlighting.

ShowError(int, int, string)

Marks a location in the text as erroneous, without moving the caret.

void ShowError(int line, int column, string message)

Parameters

line int

The 1-based line number of the error.

column int

The 1-based column number of the error.

message string

A message describing the error.

Events

TextChanged

Raised when the Text has been changed.

event EventHandler<EventArgs>? TextChanged

Event Type

EventHandler<EventArgs>