IBufferGraph::MapUpToSnapshot Method (SnapshotPoint, PointTrackingMode, PositionAffinity, ITextSnapshot^)

 

Maps a position in the current snapshot of a buffer that is a member of the buffer graph to the specified snapshot.

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

Nullable<SnapshotPoint> MapUpToSnapshot(
	SnapshotPoint point,
	PointTrackingMode trackingMode,
	PositionAffinity affinity,
	ITextSnapshot^ targetSnapshot
)

Parameters

point
Type: Microsoft.VisualStudio.Text::SnapshotPoint

A point in some buffer in the IBufferGraph.

trackingMode
Type: Microsoft.VisualStudio.Text::PointTrackingMode

How point is tracked to the current snapshot if necessary.

affinity
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.

targetSnapshot
Type: Microsoft.VisualStudio.Text::ITextSnapshot^

The snapshot to which to map.

Return Value

Type: System::Nullable<SnapshotPoint>

The corresponding position in targetSnapshot, or null if the position does not map to targetSnapshot using this graph.

Exception Condition
ArgumentNullException

point.Snapshot is null.

ArgumentOutOfRangeException

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

Return to top
Show: