Compartir a través de


SnapshotSpan.TranslateTo Method

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

Namespace:  Microsoft.VisualStudio.Text
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)

Syntax

'Declaration
Public Function TranslateTo ( _
    targetSnapshot As ITextSnapshot, _
    spanTrackingMode As SpanTrackingMode _
) As SnapshotSpan
public SnapshotSpan TranslateTo(
    ITextSnapshot targetSnapshot,
    SpanTrackingMode spanTrackingMode
)
public:
SnapshotSpan TranslateTo(
    ITextSnapshot^ targetSnapshot, 
    SpanTrackingMode spanTrackingMode
)
member TranslateTo : 
        targetSnapshot:ITextSnapshot * 
        spanTrackingMode:SpanTrackingMode -> SnapshotSpan
public function TranslateTo(
    targetSnapshot : ITextSnapshot, 
    spanTrackingMode : SpanTrackingMode
) : SnapshotSpan

Parameters

Return Value

Type: Microsoft.VisualStudio.Text.SnapshotSpan
A new snapshot span.

Exceptions

Exception Condition
ArgumentNullException

targetSnapshot is nulla null reference (Nothing in Visual Basic).

ArgumentException

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

.NET Framework Security

See Also

Reference

SnapshotSpan Structure

Microsoft.VisualStudio.Text Namespace