In This Article

EditorDocument Class

Represents a text document that can be used in an editor.

public class EditorDocument : CodeDocument, IEditorDocument, ICodeDocument, IParseTarget, ITextDocument
Inheritance:
object ObservableObjectBase TextDocumentBase CodeDocument object
Implements:
IEditorDocument ICodeDocument IParseTarget ITextDocument

Constructors

EditorDocument()

Initializes an instance of the class.

public EditorDocument()

Properties

IndicatorManager

The IIndicatorManager that manages indicators for the document.

public IIndicatorManager IndicatorManager { get; }

Property Value

IIndicatorManager

LineNumberOrigin

The origin line number to use as the base for the first view line.

public int LineNumberOrigin { get; set; }

Property Value

int:

The default value is 1.

OutliningManager

The IOutliningManager that manages outlining nodes for the document.

public IOutliningManager OutliningManager { get; }

Property Value

IOutliningManager

OutliningMode

The outlining mode for the document that determines what type of code outlining (folding) is supported.

public OutliningMode OutliningMode { get; set; }

Property Value

OutliningMode:

The default value is Default.

Text

The text in the document.

public string Text { get; set; }

Property Value

string

Remarks

This property is only intended to be used when deserializing text content from XAML.

WhitespaceTrimModes

The modes in which whitespace should be automatically trimmed.

public WhitespaceTrimModes WhitespaceTrimModes { get; set; }

Property Value

WhitespaceTrimModes:

The default value is None.

Methods

GetTextReplacementInsertText(ITextChangeOperation)

Returns the scrubbed text that should be inserted for an entire text replacement ITextChangeOperation.

protected override string? GetTextReplacementInsertText(ITextChangeOperation operation)
Parameter Type Description
operation ITextChangeOperation

The ITextChangeOperation containing default text to insert.

Returns

string

Remarks

This method can be overridden to scrub the text to insert, such as remove trailing whitespace, etc. By default it returns a null, meaning to use the unscrubbed InsertedText value.

Inherited Members

Extension Methods