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
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
SetContent(string, string)
Replaces the text in the editor.
void SetContent(string text, string formatName)
Parameters
textstringThe new text.
formatNamestringThe 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
lineintThe 1-based line number of the error.
columnintThe 1-based column number of the error.
messagestringA message describing the error.
Events
TextChanged
Raised when the Text has been changed.
event EventHandler<EventArgs>? TextChanged