MapDownToSnapshot Method (SnapshotPoint, PointTrackingMode, ITextSnapshot, PositionAffinity)
Collapse the table of content
Expand the table of content

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)

Nullable<SnapshotPoint> MapDownToSnapshot(
	SnapshotPoint position,
	PointTrackingMode trackingMode,
	ITextSnapshot targetSnapshot,
	PositionAffinity affinity


Type: Microsoft.VisualStudio.Text.SnapshotPoint

The position in a buffer in the graph.

Type: Microsoft.VisualStudio.Text.PointTrackingMode

How position is tracked to the current snapshot if necessary.

Type: Microsoft.VisualStudio.Text.ITextSnapshot

The buffer to which to map the position.

Type: Microsoft.VisualStudio.Text.PositionAffinity

If 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: System.Nullable<SnapshotPoint>

A point in a snapshot of the target buffer, or null if the top position does not map to that buffer with the given affinity.

Exception Condition

position.Snapshot or targetSnapshot is null.


trackingMode is not a valid PointTrackingMode, or affinity is not a valid PositionAffinity.

Return to top
© 2016 Microsoft