次の方法で共有


OffsetRange.Translate Method

Definition

Translates this OffsetRange to an older or newer ITextDocumentSnapshot version.

public Microsoft.VisualStudio.RpcContracts.Editor.OffsetRange Translate (Microsoft.VisualStudio.Extensibility.Editor.ITextDocumentSnapshot currentDocumentVersion, Microsoft.VisualStudio.Extensibility.Editor.ITextDocumentSnapshot targetDocumentVersion, Microsoft.VisualStudio.Extensibility.Editor.TextRangeTrackingMode textRangeTrackingMode);
member this.Translate : Microsoft.VisualStudio.Extensibility.Editor.ITextDocumentSnapshot * Microsoft.VisualStudio.Extensibility.Editor.ITextDocumentSnapshot * Microsoft.VisualStudio.Extensibility.Editor.TextRangeTrackingMode -> Microsoft.VisualStudio.RpcContracts.Editor.OffsetRange
Public Function Translate (currentDocumentVersion As ITextDocumentSnapshot, targetDocumentVersion As ITextDocumentSnapshot, textRangeTrackingMode As TextRangeTrackingMode) As OffsetRange

Parameters

currentDocumentVersion
ITextDocumentSnapshot

The document version from which to translate.

targetDocumentVersion
ITextDocumentSnapshot

The document version to which to translate.

textRangeTrackingMode
TextRangeTrackingMode

The TextRangeTrackingMode to use in the translation.

Returns

A new range.

Exceptions

currentDocumentVersion or targetDocumentVersion is null.

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

Applies to