IBufferGraph.MapDownToSnapshot Method (SnapshotPoint, PointTrackingMode, ITextSnapshot, PositionAffinity)
Maps a position in the graph to the corresponding position in a snapshot lower in the graph. Source buffers are considered to be lower than the projection buffers that consume them.
Namespace: Microsoft.VisualStudio.Text.Projection
Assembly: Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)
Syntax
'Declaration
Function MapDownToSnapshot ( _
position As SnapshotPoint, _
trackingMode As PointTrackingMode, _
targetSnapshot As ITextSnapshot, _
affinity As PositionAffinity _
) As Nullable(Of SnapshotPoint)
Nullable<SnapshotPoint> MapDownToSnapshot(
SnapshotPoint position,
PointTrackingMode trackingMode,
ITextSnapshot targetSnapshot,
PositionAffinity affinity
)
Nullable<SnapshotPoint> MapDownToSnapshot(
SnapshotPoint position,
PointTrackingMode trackingMode,
ITextSnapshot^ targetSnapshot,
PositionAffinity affinity
)
abstract MapDownToSnapshot :
position:SnapshotPoint *
trackingMode:PointTrackingMode *
targetSnapshot:ITextSnapshot *
affinity:PositionAffinity -> Nullable<SnapshotPoint>
function MapDownToSnapshot(
position : SnapshotPoint,
trackingMode : PointTrackingMode,
targetSnapshot : ITextSnapshot,
affinity : PositionAffinity
) : Nullable<SnapshotPoint>
Parameters
position
Type: Microsoft.VisualStudio.Text.SnapshotPointThe position in a buffer in the graph.
trackingMode
Type: Microsoft.VisualStudio.Text.PointTrackingModeHow position is tracked to the current snapshot if necessary.
targetSnapshot
Type: Microsoft.VisualStudio.Text.ITextSnapshotThe buffer to which to map the position.
affinity
Type: Microsoft.VisualStudio.Text.PositionAffinityIf the mapping is ambiguous (the position is on a source span seam), determines whether the mapping should target the position immediately after the preceding character or immediately before the following character in the top buffer.
This setting has no effect if the mapping is unambiguous.
Return Value
Type: Nullable<SnapshotPoint>
A point in a snapshot of the target buffer, or nulla null reference (Nothing in Visual Basic) if the top position does not map to that buffer with the given affinity.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | position.Snapshot or targetSnapshot is nulla null reference (Nothing in Visual Basic). |
ArgumentOutOfRangeException | trackingMode is not a valid PointTrackingMode, or affinity is not a valid PositionAffinity. |
.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.