SnapshotSpan.TranslateTo(ITextSnapshot, SpanTrackingMode) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.