次の方法で共有


IBufferGraph.MapUpToSnapshot Method (SnapshotPoint, PointTrackingMode, PositionAffinity, ITextSnapshot)

Maps a position in the current snapshot of a buffer that is a member of the buffer graph to the specified snapshot.

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

Syntax

'宣言
Function MapUpToSnapshot ( _
    point As SnapshotPoint, _
    trackingMode As PointTrackingMode, _
    affinity As PositionAffinity, _
    targetSnapshot As ITextSnapshot _
) As Nullable(Of SnapshotPoint)
Nullable<SnapshotPoint> MapUpToSnapshot(
    SnapshotPoint point,
    PointTrackingMode trackingMode,
    PositionAffinity affinity,
    ITextSnapshot targetSnapshot
)
Nullable<SnapshotPoint> MapUpToSnapshot(
    SnapshotPoint point, 
    PointTrackingMode trackingMode, 
    PositionAffinity affinity, 
    ITextSnapshot^ targetSnapshot
)
abstract MapUpToSnapshot : 
        point:SnapshotPoint * 
        trackingMode:PointTrackingMode * 
        affinity:PositionAffinity * 
        targetSnapshot:ITextSnapshot -> Nullable<SnapshotPoint> 
function MapUpToSnapshot(
    point : SnapshotPoint, 
    trackingMode : PointTrackingMode, 
    affinity : PositionAffinity, 
    targetSnapshot : ITextSnapshot
) : 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>
The corresponding position in targetSnapshot, or nulla null reference (Nothing in Visual Basic) if the position does not map to targetSnapshot using this graph.

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

See Also

Reference

IBufferGraph Interface

MapUpToSnapshot Overload

Microsoft.VisualStudio.Text.Projection Namespace