In This Article

ITextChangeOptions Interface

Provides the base requirements for options that are applied to an ITextChange.

public interface ITextChangeOptions

Properties

CanMergeIntoPreviousChange

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

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.

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.

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.

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.

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.

object? Source { get; set; }

Property Value

object

Extension Methods