次の方法で共有


IBufferGraph.MapDownToBuffer Method (SnapshotPoint, PointTrackingMode, ITextBuffer, PositionAffinity)

Maps a position in the graph to the corresponding position in a buffer 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)

Syntax

'宣言
Function MapDownToBuffer ( _
    position As SnapshotPoint, _
    trackingMode As PointTrackingMode, _
    targetBuffer As ITextBuffer, _
    affinity As PositionAffinity _
) As Nullable(Of SnapshotPoint)
Nullable<SnapshotPoint> MapDownToBuffer(
    SnapshotPoint position,
    PointTrackingMode trackingMode,
    ITextBuffer targetBuffer,
    PositionAffinity affinity
)
Nullable<SnapshotPoint> MapDownToBuffer(
    SnapshotPoint position, 
    PointTrackingMode trackingMode, 
    ITextBuffer^ targetBuffer, 
    PositionAffinity affinity
)
abstract MapDownToBuffer : 
        position:SnapshotPoint * 
        trackingMode:PointTrackingMode * 
        targetBuffer:ITextBuffer * 
        affinity:PositionAffinity -> Nullable<SnapshotPoint> 
function MapDownToBuffer(
    position : SnapshotPoint, 
    trackingMode : PointTrackingMode, 
    targetBuffer : ITextBuffer, 
    affinity : PositionAffinity
) : Nullable<SnapshotPoint>

Parameters

  • 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 nulla null reference (Nothing in Visual Basic) if the top position does not map to that buffer with the given affinity.

Exceptions

Exception Condition
ArgumentNullException

position.Snapshot or targetBuffer is nulla null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

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

.NET Framework Security

See Also

Reference

IBufferGraph Interface

MapDownToBuffer Overload

Microsoft.VisualStudio.Text.Projection Namespace