Compartilhar via


IProjectionSnapshot.MapToSourceSnapshots Method

Definition

Overloads

MapToSourceSnapshots(Span)

Maps a span of the current projection snapshot to a list of snapshot spans belonging to source snapshots. The resulting spans will be ordered by the order of their appearance in the projection.

MapToSourceSnapshots(Int32)

Maps a position in the projection snapshot to the corresponding position in one or more source snapshots.

MapToSourceSnapshots(Span)

Maps a span of the current projection snapshot to a list of snapshot spans belonging to source snapshots. The resulting spans will be ordered by the order of their appearance in the projection.

public:
 System::Collections::ObjectModel::ReadOnlyCollection<Microsoft::VisualStudio::Text::SnapshotSpan> ^ MapToSourceSnapshots(Microsoft::VisualStudio::Text::Span span);
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.VisualStudio.Text.SnapshotSpan> MapToSourceSnapshots (Microsoft.VisualStudio.Text.Span span);
abstract member MapToSourceSnapshots : Microsoft.VisualStudio.Text.Span -> System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.VisualStudio.Text.SnapshotSpan>
Public Function MapToSourceSnapshots (span As Span) As ReadOnlyCollection(Of SnapshotSpan)

Parameters

span
Span

The span in the projection snapshot.

Returns

A non-empty list of snapshot spans.

Exceptions

span is not valid for this buffer.

Remarks

If a null span occurs on a source span seam, it may map to more than one null source span.

Applies to

MapToSourceSnapshots(Int32)

Maps a position in the projection snapshot to the corresponding position in one or more source snapshots.

public:
 System::Collections::ObjectModel::ReadOnlyCollection<Microsoft::VisualStudio::Text::SnapshotPoint> ^ MapToSourceSnapshots(int position);
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.VisualStudio.Text.SnapshotPoint> MapToSourceSnapshots (int position);
abstract member MapToSourceSnapshots : int -> System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.VisualStudio.Text.SnapshotPoint>
Public Function MapToSourceSnapshots (position As Integer) As ReadOnlyCollection(Of SnapshotPoint)

Parameters

position
Int32

The position in the projection snapshot.

Returns

A read-only collection of snapshot points to which the position maps. This collection contains one snapshot point unless the position lies on a source span seam, in which case it can contain two or more points.

Exceptions

position is less than zero or greater than or equal to the length of the snapshot.

Remarks

In general, a source span seam occurs at the end of a source span of nonzero length and the beginning of a source span of nonzero length, and coincides with zero or more source spans of zero length. Every span on a seam has a point in the result collection.

Applies to