IMappingPoint::GetPoint Method (ITextSnapshot^, PositionAffinity)

 

Maps the point to a particular ITextSnapshot.

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

Nullable<SnapshotPoint> GetPoint(
	ITextSnapshot^ targetSnapshot,
	PositionAffinity affinity
)

Parameters

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

The ITextSnapshot to which to map the point.

affinity
Type: Microsoft.VisualStudio.Text::PositionAffinity

If the mapping is ambiguous (the position lies on a source span seam), this parameter affects the mapping as follows:

if affinity is Predecessor, the mapping targets the position immediately after the preceding character in the anchor buffer

if affinity is Successor, the mapping targets the position immediately before the following character in the anchor buffer

This parameter has no effect if the mapping is unambiguous.

Return Value

Type: System::Nullable<SnapshotPoint>

A nullable SnapshotPoint.

Exception Condition
ArgumentNullException

targetSnapshot is null.

In general, a source span seam occurs at the end of a source span of nonzero length and the beginning of a source span of nonzero length, and coincides with zero or more source spans of zero length. Every span on a seam has a point in the result collection.

Return to top
Show: