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
)

Parameters

position
Type: Microsoft.VisualStudio.Text.SnapshotPoint

The position in a buffer in the graph.

trackingMode
Type: Microsoft.VisualStudio.Text.PointTrackingMode

How position is tracked to the current snapshot if necessary.

targetSnapshot
Type: Microsoft.VisualStudio.Text.ITextSnapshot

The buffer to which to map the position.

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.

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
ArgumentNullException

position.Snapshot or targetSnapshot is null.

ArgumentOutOfRangeException

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

Return to top
Show:
© 2016 Microsoft