共用方式為


VirtualSnapshotSpan.TranslateTo Method (ITextSnapshot, SpanTrackingMode)

Translates this span to the specified snapshot with the given tracking mode.

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

Syntax

'宣告
Public Function TranslateTo ( _
    snapshot As ITextSnapshot, _
    trackingMode As SpanTrackingMode _
) As VirtualSnapshotSpan
public VirtualSnapshotSpan TranslateTo(
    ITextSnapshot snapshot,
    SpanTrackingMode trackingMode
)
public:
VirtualSnapshotSpan TranslateTo(
    ITextSnapshot^ snapshot, 
    SpanTrackingMode trackingMode
)
member TranslateTo : 
        snapshot:ITextSnapshot * 
        trackingMode:SpanTrackingMode -> VirtualSnapshotSpan 
public function TranslateTo(
    snapshot : ITextSnapshot, 
    trackingMode : SpanTrackingMode
) : VirtualSnapshotSpan

Parameters

Return Value

Type: Microsoft.VisualStudio.Text.VirtualSnapshotSpan
The corresponding VirtualSnapshotSpan in snapshot.

Exceptions

Exception Condition
ArgumentException

snapshot is for an earlier snapshot.

Remarks

See TranslateTo for a description of how VirtualSnapshotPoint translation behaves.

.NET Framework Security

See Also

Reference

VirtualSnapshotSpan Structure

TranslateTo Overload

Microsoft.VisualStudio.Text Namespace