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.

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.

ResetLineNumberOrigin()

Resets the LineNumberOrigin property to its default value.

public void ResetLineNumberOrigin()

ResetOutliningMode()

Resets the OutliningMode property to its default value.

public void ResetOutliningMode()

ResetWhitespaceTrimModes()

Resets the WhitespaceTrimModes property to its default value.

public void ResetWhitespaceTrimModes()

ShouldSerializeLineNumberOrigin()

Indicates whether the LineNumberOrigin property should be persisted.

public bool ShouldSerializeLineNumberOrigin()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeOutliningMode()

Indicates whether the OutliningMode property should be persisted.

public bool ShouldSerializeOutliningMode()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeWhitespaceTrimModes()

Indicates whether the WhitespaceTrimModes property should be persisted.

public bool ShouldSerializeWhitespaceTrimModes()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

Inherited Members

Extension Methods