다음을 통해 공유


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)

Syntax

'Declaration
Function GetPoint ( _
    targetBuffer As ITextBuffer, _
    affinity As PositionAffinity _
) As Nullable(Of SnapshotPoint)
Nullable<SnapshotPoint> GetPoint(
    ITextBuffer targetBuffer,
    PositionAffinity affinity
)
Nullable<SnapshotPoint> GetPoint(
    ITextBuffer^ targetBuffer, 
    PositionAffinity affinity
)
abstract GetPoint : 
        targetBuffer:ITextBuffer * 
        affinity:PositionAffinity -> Nullable<SnapshotPoint> 
function GetPoint(
    targetBuffer : ITextBuffer, 
    affinity : PositionAffinity
) : Nullable<SnapshotPoint>

Parameters

  • 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: Nullable<SnapshotPoint>
A SnapshotPoint in the targeted buffer, or nulla null reference (Nothing in Visual Basic) if the point and affinity do not appear in that buffer.

Exceptions

Exception Condition
ArgumentNullException

targetBuffer is null.

Remarks

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.

.NET Framework Security

See Also

Reference

IMappingPoint Interface

GetPoint Overload

Microsoft.VisualStudio.Text Namespace