Compartir a través de


IBufferGraph.MapDownToFirstMatch Method

Definition

Overloads

MapDownToFirstMatch(SnapshotSpan, SpanTrackingMode, Predicate<ITextSnapshot>)

Maps a snapshot span in some buffer in the graph to a sequence of zero or more spans in some source snapshot selected by a predicate.

MapDownToFirstMatch(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.

MapDownToFirstMatch(SnapshotSpan, SpanTrackingMode, Predicate<ITextSnapshot>)

Maps a snapshot span in some buffer in the graph to a sequence of zero or more spans in some source snapshot selected by a predicate.

public:
 Microsoft::VisualStudio::Text::NormalizedSnapshotSpanCollection ^ MapDownToFirstMatch(Microsoft::VisualStudio::Text::SnapshotSpan span, Microsoft::VisualStudio::Text::SpanTrackingMode trackingMode, Predicate<Microsoft::VisualStudio::Text::ITextSnapshot ^> ^ match);
public Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection MapDownToFirstMatch (Microsoft.VisualStudio.Text.SnapshotSpan span, Microsoft.VisualStudio.Text.SpanTrackingMode trackingMode, Predicate<Microsoft.VisualStudio.Text.ITextSnapshot> match);
abstract member MapDownToFirstMatch : Microsoft.VisualStudio.Text.SnapshotSpan * Microsoft.VisualStudio.Text.SpanTrackingMode * Predicate<Microsoft.VisualStudio.Text.ITextSnapshot> -> Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection
Public Function MapDownToFirstMatch (span As SnapshotSpan, trackingMode As SpanTrackingMode, match As Predicate(Of ITextSnapshot)) As NormalizedSnapshotSpanCollection

Parameters

span
SnapshotSpan

The span that is to be mapped.

trackingMode
SpanTrackingMode

How span is tracked to the current snapshot if necessary.

match
Predicate<ITextSnapshot>

The predicate that identifies the target buffer.

Returns

A collection of zero or more snapshot spans in the target buffer to which the topSpan maps.

Exceptions

span.Snapshot or match is null.

trackingMode is not a valid SpanTrackingMode.

Remarks

match is called on each text buffer in the buffer graph until it returns true. The predicate will not be called again.

Applies to

MapDownToFirstMatch(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.

public:
 Nullable<Microsoft::VisualStudio::Text::SnapshotPoint> MapDownToFirstMatch(Microsoft::VisualStudio::Text::SnapshotPoint position, Microsoft::VisualStudio::Text::PointTrackingMode trackingMode, Predicate<Microsoft::VisualStudio::Text::ITextSnapshot ^> ^ match, Microsoft::VisualStudio::Text::PositionAffinity affinity);
public Microsoft.VisualStudio.Text.SnapshotPoint? MapDownToFirstMatch (Microsoft.VisualStudio.Text.SnapshotPoint position, Microsoft.VisualStudio.Text.PointTrackingMode trackingMode, Predicate<Microsoft.VisualStudio.Text.ITextSnapshot> match, Microsoft.VisualStudio.Text.PositionAffinity affinity);
abstract member MapDownToFirstMatch : Microsoft.VisualStudio.Text.SnapshotPoint * Microsoft.VisualStudio.Text.PointTrackingMode * Predicate<Microsoft.VisualStudio.Text.ITextSnapshot> * Microsoft.VisualStudio.Text.PositionAffinity -> Nullable<Microsoft.VisualStudio.Text.SnapshotPoint>
Public Function MapDownToFirstMatch (position As SnapshotPoint, trackingMode As PointTrackingMode, match As Predicate(Of ITextSnapshot), affinity As PositionAffinity) As Nullable(Of SnapshotPoint)

Parameters

position
SnapshotPoint

The position in a buffer in the graph.

trackingMode
PointTrackingMode

How position is tracked to the current snapshot if necessary.

match
Predicate<ITextSnapshot>

The predicate that identifies the target buffer.

affinity
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.

Returns

A point in a snapshot of the target buffer, or null if position does not map down to any buffer selected by match.

Exceptions

position.Snapshot or match is null.

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. The predicate will not be called again.

Applies to