In This Article

ITextVersion Interface

Provides the base requirements for a version of an ITextDocument.

public interface ITextVersion

Properties

Document

The ITextDocument for which this version applies.

ITextDocument Document { get; }

Property Value

ITextDocument

Length

The number of characters in the version.

int Length { get; }

Property Value

int

Next

The next ITextVersion that occurs after this one.

ITextVersion? Next { get; }

Property Value

ITextVersion

Number

The integer version number associated with this instance.

int Number { get; }

Property Value

int

Operations

The read-only list of ITextChangeRangedOperation objects that can be applied to this text version to generate the next version.

IList<ITextChangeRangedOperation>? Operations { get; }

Property Value

IList<ITextChangeRangedOperation>

Remarks

This property returns null for the most current version of a document.

Methods

CreateRange(TextRange)

Creates an ITextVersionRange that stores data about a text range in this version and can be used to translate to other versions.

ITextVersionRange CreateRange(TextRange textRange)
Parameter Type Description
textRange TextRange

A TextRange indicating the range of text within this version.

Returns

ITextVersionRange

CreateRange(TextRange, TextRangeTrackingModes)

Creates an ITextVersionRange that stores data about a text range in this version and can be used to translate to other versions.

ITextVersionRange CreateRange(TextRange textRange, TextRangeTrackingModes trackingModes)
Parameter Type Description
textRange TextRange

A TextRange indicating the range of text within this version.

trackingModes TextRangeTrackingModes

A TextRangeTrackingModes indicating the tracking modes to use.

Returns

ITextVersionRange

CreateRange(TextRange, Func<TextRangeTrackingModes>)

Creates an ITextVersionRange that stores data about a text range in this version and can be used to translate to other versions.

ITextVersionRange CreateRange(TextRange textRange, Func<TextRangeTrackingModes> trackingModesFunc)
Parameter Type Description
textRange TextRange

A TextRange indicating the range of text within this version.

trackingModesFunc Func<TextRangeTrackingModes>

A function that dynamically returns a TextRangeTrackingModes indicating the tracking modes to use.

Returns

ITextVersionRange

CreateRange(int, int)

Creates an ITextVersionRange that stores data about a text range in this version and can be used to translate to other versions.

ITextVersionRange CreateRange(int startOffset, int length)
Parameter Type Description
startOffset int

The start offset in the range.

length int

The length of the range.

Returns

ITextVersionRange

CreateRange(int, int, TextRangeTrackingModes)

Creates an ITextVersionRange that stores data about a text range in this version and can be used to translate to other versions.

ITextVersionRange CreateRange(int startOffset, int length, TextRangeTrackingModes trackingModes)
Parameter Type Description
startOffset int

The start offset in the range.

length int

The length of the range.

trackingModes TextRangeTrackingModes

A TextRangeTrackingModes indicating the tracking modes to use.

Returns

ITextVersionRange

Extension Methods