IBufferGraph.MapUpToBuffer Method (SnapshotPoint, PointTrackingMode, PositionAffinity, ITextBuffer)
Maps a position in the current snapshot of some buffer that is a member of the buffer graph to a snapshot of some buffer.
Namespace: Microsoft.VisualStudio.Text.Projection
Assembly: Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)
Syntax
'Declaration
Function MapUpToBuffer ( _
point As SnapshotPoint, _
trackingMode As PointTrackingMode, _
affinity As PositionAffinity, _
targetBuffer As ITextBuffer _
) As Nullable(Of SnapshotPoint)
Nullable<SnapshotPoint> MapUpToBuffer(
SnapshotPoint point,
PointTrackingMode trackingMode,
PositionAffinity affinity,
ITextBuffer targetBuffer
)
Nullable<SnapshotPoint> MapUpToBuffer(
SnapshotPoint point,
PointTrackingMode trackingMode,
PositionAffinity affinity,
ITextBuffer^ targetBuffer
)
abstract MapUpToBuffer :
point:SnapshotPoint *
trackingMode:PointTrackingMode *
affinity:PositionAffinity *
targetBuffer:ITextBuffer -> Nullable<SnapshotPoint>
function MapUpToBuffer(
point : SnapshotPoint,
trackingMode : PointTrackingMode,
affinity : PositionAffinity,
targetBuffer : ITextBuffer
) : Nullable<SnapshotPoint>
Parameters
point
Type: Microsoft.VisualStudio.Text.SnapshotPointA point in some buffer in the IBufferGraph.
trackingMode
Type: Microsoft.VisualStudio.Text.PointTrackingModeHow point is tracked to the current snapshot if necessary.
affinity
Type: Microsoft.VisualStudio.Text.PositionAffinityIf 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.
targetBuffer
Type: Microsoft.VisualStudio.Text.ITextBufferThe buffer to which to map.
Return Value
Type: Nullable<SnapshotPoint>
The corresponding position in a snapshot of the target buffer, or nulla null reference (Nothing in Visual Basic) if the position does not map to the target buffer.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | point.Snapshot 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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.