Condividi tramite


SnapshotSpan.TranslateTo(ITextSnapshot, SpanTrackingMode) Method

Definition

Translates this snapshot span to a different snapshot of the same ITextBuffer.

public:
 Microsoft::VisualStudio::Text::SnapshotSpan TranslateTo(Microsoft::VisualStudio::Text::ITextSnapshot ^ targetSnapshot, Microsoft::VisualStudio::Text::SpanTrackingMode spanTrackingMode);
Microsoft::VisualStudio::Text::SnapshotSpan TranslateTo(Microsoft::VisualStudio::Text::ITextSnapshot const & targetSnapshot, Microsoft::VisualStudio::Text::SpanTrackingMode spanTrackingMode);
public Microsoft.VisualStudio.Text.SnapshotSpan TranslateTo (Microsoft.VisualStudio.Text.ITextSnapshot targetSnapshot, Microsoft.VisualStudio.Text.SpanTrackingMode spanTrackingMode);
member this.TranslateTo : Microsoft.VisualStudio.Text.ITextSnapshot * Microsoft.VisualStudio.Text.SpanTrackingMode -> Microsoft.VisualStudio.Text.SnapshotSpan
Public Function TranslateTo (targetSnapshot As ITextSnapshot, spanTrackingMode As SpanTrackingMode) As SnapshotSpan

Parameters

targetSnapshot
ITextSnapshot

The snapshot to which to translate.

spanTrackingMode
SpanTrackingMode

The SpanTrackingMode to use in the translation.

Returns

A new snapshot span.

Exceptions

targetSnapshot is null.

targetSnapshot does not refer to the same ITextBuffer as this snapshot span.

Applies to