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 TextDocumentBase CodeDocument object
Implements:
IEditorDocument ICodeDocument IParseTarget ITextDocument

Constructors

EditorDocument()

Initializes a new instance of the EditorDocument class.

public EditorDocument()

Properties

IndicatorManager

Gets the IIndicatorManager that manages indicators for the document.

public IIndicatorManager IndicatorManager { get; }

Property Value

IIndicatorManager:

The IIndicatorManager that manages indicators for the document.

LineNumberOrigin

Gets or sets the origin line number to use as the base for the first view line.

public int LineNumberOrigin { get; set; }

Property Value

int:

The origin line number to use as the base for the first view line. The default value is 1.

OutliningManager

Gets the IOutliningManager that manages outlining nodes for the document.

public IOutliningManager OutliningManager { get; }

Property Value

IOutliningManager:

The IOutliningManager that manages outlining nodes for the document. The default value is OutliningMode.Default.

OutliningMode

Gets or sets the OutliningMode for the document that determines what type of code outlining (folding) is supported.

public OutliningMode OutliningMode { get; set; }

Property Value

OutliningMode:

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

Text

Gets or sets the text in the document.

public string Text { get; set; }

Property Value

string:

The text in the document.

Remarks

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

WhitespaceTrimModes

Gets or sets the modes in which whitespace should be automatically trimmed.

public WhitespaceTrimModes WhitespaceTrimModes { get; set; }

Property Value

WhitespaceTrimModes:

A WhitespaceTrimModes indicating the modes in which whitespace should be automatically trimmed. 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:

The text to insert.

Remarks

This method can be overridden to scrub the text to insert, such as remove trailing whitespace, etc.

Inherited Members