Compartilhar via


TextPosition.TranslateTo Method

Definition

Translates this TextPosition to an older or newer ITextDocumentSnapshot version.

public Microsoft.VisualStudio.Extensibility.Editor.TextPosition TranslateTo (Microsoft.VisualStudio.Extensibility.Editor.ITextDocumentSnapshot targetDocumentVersion, Microsoft.VisualStudio.Extensibility.Editor.TextPositionTrackingMode trackingMode);
member this.TranslateTo : Microsoft.VisualStudio.Extensibility.Editor.ITextDocumentSnapshot * Microsoft.VisualStudio.Extensibility.Editor.TextPositionTrackingMode -> Microsoft.VisualStudio.Extensibility.Editor.TextPosition
Public Function TranslateTo (targetDocumentVersion As ITextDocumentSnapshot, trackingMode As TextPositionTrackingMode) As TextPosition

Parameters

targetDocumentVersion
ITextDocumentSnapshot

The document version to which to translate.

trackingMode
TextPositionTrackingMode

The TextPositionTrackingMode to use in the translation.

Returns

A TextPosition that has been mapped to the requested document version.

Exceptions

targetDocumentVersion is null.

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

Applies to