共用方式為


ITextDocumentSnapshot.TranslatePositionTo Method

Definition

Translates a TextPosition forward or backward in time to this ITextDocumentSnapshot's version.

public Microsoft.VisualStudio.Extensibility.Editor.TextPosition TranslatePositionTo (Microsoft.VisualStudio.Extensibility.Editor.TextPosition position, Microsoft.VisualStudio.Extensibility.Editor.TextPositionTrackingMode trackingMode);
abstract member TranslatePositionTo : Microsoft.VisualStudio.Extensibility.Editor.TextPosition * Microsoft.VisualStudio.Extensibility.Editor.TextPositionTrackingMode -> Microsoft.VisualStudio.Extensibility.Editor.TextPosition
Public Function TranslatePositionTo (position As TextPosition, trackingMode As TextPositionTrackingMode) As TextPosition

Parameters

position
TextPosition

Position to translate

trackingMode
TextPositionTrackingMode

The TextPositionTrackingMode to use in the translation.

Returns

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

Exceptions

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

Applies to