Freigeben über


TextRange.TranslateTo(ITextDocumentSnapshot, TextRangeTrackingMode) Method

Definition

Translates this TextRange to an older or newer ITextDocumentSnapshot version.

public Microsoft.VisualStudio.Extensibility.Editor.TextRange TranslateTo (Microsoft.VisualStudio.Extensibility.Editor.ITextDocumentSnapshot targetDocumentVersion, Microsoft.VisualStudio.Extensibility.Editor.TextRangeTrackingMode rangeTrackingMode);
member this.TranslateTo : Microsoft.VisualStudio.Extensibility.Editor.ITextDocumentSnapshot * Microsoft.VisualStudio.Extensibility.Editor.TextRangeTrackingMode -> Microsoft.VisualStudio.Extensibility.Editor.TextRange
Public Function TranslateTo (targetDocumentVersion As ITextDocumentSnapshot, rangeTrackingMode As TextRangeTrackingMode) As TextRange

Parameters

targetDocumentVersion
ITextDocumentSnapshot

The document version to which to translate.

rangeTrackingMode
TextRangeTrackingMode

The TextRangeTrackingMode to use in the translation.

Returns

A new snapshot range.

Exceptions

targetDocumentVersion is null.

targetDocumentVersion does not refer to the same underlying text document as this TextPosition.

Applies to