Partilhar via


IMappingSpan.GetSpans Method

Definition

Overloads

GetSpans(ITextBuffer)

Maps the span to a particular ITextBuffer.

GetSpans(ITextSnapshot)

Maps the span to a particular ITextSnapshot.

GetSpans(Predicate<ITextBuffer>)

Maps the span to a matching ITextBuffer.

GetSpans(ITextBuffer)

Maps the span to a particular ITextBuffer.

public:
 Microsoft::VisualStudio::Text::NormalizedSnapshotSpanCollection ^ GetSpans(Microsoft::VisualStudio::Text::ITextBuffer ^ targetBuffer);
public Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection GetSpans (Microsoft.VisualStudio.Text.ITextBuffer targetBuffer);
abstract member GetSpans : Microsoft.VisualStudio.Text.ITextBuffer -> Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection
Public Function GetSpans (targetBuffer As ITextBuffer) As NormalizedSnapshotSpanCollection

Parameters

targetBuffer
ITextBuffer

The ITextBuffer to which to map the span.

Returns

The possibly empty collection of spans in the targetBuffer to which the span maps.

Exceptions

targetBuffer is null.

Applies to

GetSpans(ITextSnapshot)

Maps the span to a particular ITextSnapshot.

public:
 Microsoft::VisualStudio::Text::NormalizedSnapshotSpanCollection ^ GetSpans(Microsoft::VisualStudio::Text::ITextSnapshot ^ targetSnapshot);
public Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection GetSpans (Microsoft.VisualStudio.Text.ITextSnapshot targetSnapshot);
abstract member GetSpans : Microsoft.VisualStudio.Text.ITextSnapshot -> Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection
Public Function GetSpans (targetSnapshot As ITextSnapshot) As NormalizedSnapshotSpanCollection

Parameters

targetSnapshot
ITextSnapshot

The ITextSnapshot to which to map the span.

Returns

The possibly empty collection of spans in the targetSnapshot to which the span maps.

Exceptions

targetSnapshot is null.

Applies to

GetSpans(Predicate<ITextBuffer>)

Maps the span to a matching ITextBuffer.

public:
 Microsoft::VisualStudio::Text::NormalizedSnapshotSpanCollection ^ GetSpans(Predicate<Microsoft::VisualStudio::Text::ITextBuffer ^> ^ match);
public Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection GetSpans (Predicate<Microsoft.VisualStudio.Text.ITextBuffer> match);
abstract member GetSpans : Predicate<Microsoft.VisualStudio.Text.ITextBuffer> -> Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection
Public Function GetSpans (match As Predicate(Of ITextBuffer)) As NormalizedSnapshotSpanCollection

Parameters

match
Predicate<ITextBuffer>

The predicate used to identify the ITextBuffer.

Returns

A possibly empty collection of spans in the matching buffer.

Exceptions

match is null.

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