In This Article

TextChangeOptions Class

Represents options that are applied to an ITextChange.

public class TextChangeOptions : ITextChangeOptions
Inheritance:
object object
Derived:
EditorViewTextChangeOptions
Implements:
ITextChangeOptions

Constructors

TextChangeOptions()

Initializes an instance of the class.

public TextChangeOptions()

Properties

CanMergeIntoPreviousChange

Indicates whether this text change can merge into the previous text change in the undo stack, assuming one is available.

public bool CanMergeIntoPreviousChange { get; set; }

Property Value

bool:

true if this text change can merge into the previous text change in the undo stack; otherwise, false.

Remarks

When true, if an undo occurs after this text change, this text change's operations along with those of the previous text change would occur as a single undoable text change.

CheckReadOnly

Indicates whether to prevent the text change from occurring if the text range to modify is flagged as read-only.

public bool CheckReadOnly { get; set; }

Property Value

bool:

true if the read-only state should be checked; otherwise, false.

CustomData

Custom data that can be persisted with the text change and restored when undo operations occur later on.

public object? CustomData { get; set; }

Property Value

object

Remarks

This custom data is only persisted for the root text change of a set of operations.

OffsetDelta

Indicates how an ITextChange's ITextChangeOperation offsets are modified based on previously-added operations.

public TextChangeOffsetDelta OffsetDelta { get; set; }

Property Value

TextChangeOffsetDelta:

A TextChangeOffsetDelta value indicating how to apply offset deltas, if at all.

RetainSelection

Indicates whether to prevent the caret from moving to the end of the text change in the active view.

public bool RetainSelection { get; set; }

Property Value

bool:

true if the caret move should be prevented; otherwise, false.

Source

The optional source of the text change, which is most often an editor view if specified.

public object? Source { get; set; }

Property Value

object

Inherited Members

Extension Methods