IBufferGraph.MapUpToFirstMatch Method (SnapshotPoint, PointTrackingMode, Predicate<ITextSnapshot>, PositionAffinity)
Maps a position in the current snapshot of some buffer that is a member of the buffer graph to a snapshot of some buffer that is selected by a predicate.
Namespace: Microsoft.VisualStudio.Text.Projection
Assembly: Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)
Syntax
'Declaração
Function MapUpToFirstMatch ( _
point As SnapshotPoint, _
trackingMode As PointTrackingMode, _
match As Predicate(Of ITextSnapshot), _
affinity As PositionAffinity _
) As Nullable(Of SnapshotPoint)
Nullable<SnapshotPoint> MapUpToFirstMatch(
SnapshotPoint point,
PointTrackingMode trackingMode,
Predicate<ITextSnapshot> match,
PositionAffinity affinity
)
Nullable<SnapshotPoint> MapUpToFirstMatch(
SnapshotPoint point,
PointTrackingMode trackingMode,
Predicate<ITextSnapshot^>^ match,
PositionAffinity affinity
)
abstract MapUpToFirstMatch :
point:SnapshotPoint *
trackingMode:PointTrackingMode *
match:Predicate<ITextSnapshot> *
affinity:PositionAffinity -> Nullable<SnapshotPoint>
function MapUpToFirstMatch(
point : SnapshotPoint,
trackingMode : PointTrackingMode,
match : Predicate<ITextSnapshot>,
affinity : PositionAffinity
) : Nullable<SnapshotPoint>
Parameters
- point
Type: Microsoft.VisualStudio.Text.SnapshotPoint
A point in some buffer in the IBufferGraph.
- trackingMode
Type: Microsoft.VisualStudio.Text.PointTrackingMode
How point 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>
The corresponding position in a snapshot of the matching buffer, or nulla null reference (Nothing in Visual Basic) if does not map to the matching buffer.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | point.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
match is called for each text buffer in the buffer graph until it returns true. The predicate will not be 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.