VirtualSnapshotPoint.TranslateTo Method (ITextSnapshot, PointTrackingMode)
Translates this point to the specified text snapshot with the specified 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 PointTrackingMode _
) As VirtualSnapshotPoint
public VirtualSnapshotPoint TranslateTo(
ITextSnapshot snapshot,
PointTrackingMode trackingMode
)
public:
VirtualSnapshotPoint TranslateTo(
ITextSnapshot^ snapshot,
PointTrackingMode trackingMode
)
member TranslateTo :
snapshot:ITextSnapshot *
trackingMode:PointTrackingMode -> VirtualSnapshotPoint
public function TranslateTo(
snapshot : ITextSnapshot,
trackingMode : PointTrackingMode
) : VirtualSnapshotPoint
Parameters
- snapshot
Type: Microsoft.VisualStudio.Text.ITextSnapshot
The target snapshot.
- trackingMode
Type: Microsoft.VisualStudio.Text.PointTrackingMode
The tracking mode to use.
Return Value
Type: Microsoft.VisualStudio.Text.VirtualSnapshotPoint
The corresponding VirtualSnapshotPoint in snapshot.
Exceptions
Exception | Condition |
---|---|
ArgumentException | snapshot is for an earlier snapshot. |
Remarks
The tracking mode is relative to the virtual point, not the snapshot point. If the point is in virtual space, it will behave as though the underlying (non-virtual) point were always tracking positive, because any text inserted at the point (at the end of the line it is on) will still be inserted "before" the virtual point.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.