IMappingPoint::GetPoint Method (Predicate<ITextBuffer^>^, PositionAffinity)

 

Maps the point to a matching ITextBuffer.

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

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

Parameters

match
Type: System::Predicate<ITextBuffer^>^

The predicate used to match the ITextBuffer.

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

Exception Condition
ArgumentNullException

match is null.

match is called for each text buffer in the buffer graph until a match is found. This selects the buffer of interest, and the predicate will not be called again. If no match is found, the result is null.

Return to top
Show: