IMappingPoint::GetPoint Method (ITextBuffer^, PositionAffinity)

 

Maps the point to a particular ITextBuffer.

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

Nullable<SnapshotPoint> GetPoint(
	ITextBuffer^ targetBuffer,
	PositionAffinity affinity
)

Parameters

targetBuffer
Type: Microsoft.VisualStudio.Text::ITextBuffer^

The ITextBuffer 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 SnapshotPoint in the targeted buffer, or null if the point and affinity do not appear in that buffer.

Exception Condition
ArgumentNullException

targetBuffer 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: