IBufferGraph.MapDownToFirstMatch Method (SnapshotPoint, PointTrackingMode, Predicate<ITextSnapshot>, PositionAffinity)
Maps a position in the graph to a position in a matching buffer that is 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
'Dichiarazione
Function MapDownToFirstMatch ( _
position As SnapshotPoint, _
trackingMode As PointTrackingMode, _
match As Predicate(Of ITextSnapshot), _
affinity As PositionAffinity _
) As Nullable(Of SnapshotPoint)
Nullable<SnapshotPoint> MapDownToFirstMatch(
SnapshotPoint position,
PointTrackingMode trackingMode,
Predicate<ITextSnapshot> match,
PositionAffinity affinity
)
Nullable<SnapshotPoint> MapDownToFirstMatch(
SnapshotPoint position,
PointTrackingMode trackingMode,
Predicate<ITextSnapshot^>^ match,
PositionAffinity affinity
)
abstract MapDownToFirstMatch :
position:SnapshotPoint *
trackingMode:PointTrackingMode *
match:Predicate<ITextSnapshot> *
affinity:PositionAffinity -> Nullable<SnapshotPoint>
function MapDownToFirstMatch(
position : SnapshotPoint,
trackingMode : PointTrackingMode,
match : Predicate<ITextSnapshot>,
affinity : PositionAffinity
) : Nullable<SnapshotPoint>
Parameters
- position
Type: Microsoft.VisualStudio.Text.SnapshotPoint
The position in a buffer in the graph.
- trackingMode
Type: Microsoft.VisualStudio.Text.PointTrackingMode
How position is tracked to the current snapshot if necessary.
- match
Type: System.Predicate<ITextSnapshot>
The predicate that identifies the target buffer.
- 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 position does not map down to any buffer selected by match.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | position.Snapshot or match is nulla null reference (Nothing in Visual Basic). |
ArgumentOutOfRangeException | trackingMode is not a valid PointTrackingMode, or affinity is not a valid PositionAffinity. |
Remarks
The match predicate is called on each text buffer in the buffer graph until it returns true. After that the predicate is not called again.
.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.