IBufferGraph.MapUpToSnapshot Method

Definition

Overloads

MapUpToSnapshot(SnapshotSpan, SpanTrackingMode, ITextSnapshot)

Maps a span in the current snapshot of a buffer that is a member of the buffer graph to a sequence of spans in a snapshot of a designated buffer.

MapUpToSnapshot(SnapshotPoint, PointTrackingMode, PositionAffinity, ITextSnapshot)

Maps a position in the current snapshot of a buffer that is a member of the buffer graph to the specified snapshot.

MapUpToSnapshot(SnapshotSpan, SpanTrackingMode, ITextSnapshot)

Maps a span in the current snapshot of a buffer that is a member of the buffer graph to a sequence of spans in a snapshot of a designated buffer.

public Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection MapUpToSnapshot (Microsoft.VisualStudio.Text.SnapshotSpan span, Microsoft.VisualStudio.Text.SpanTrackingMode trackingMode, Microsoft.VisualStudio.Text.ITextSnapshot targetSnapshot);
Parameters
span
SnapshotSpan

A span in some buffer in the IBufferGraph.

trackingMode
SpanTrackingMode

How span is tracked to the current snapshot if necessary.

targetSnapshot
ITextSnapshot

The snapshot to which to map.

Returns

A collection of zero or more snapshot spans in targetSnapshot to which the span maps using this graph.

Exceptions

span.Snapshot is null.

MapUpToSnapshot(SnapshotPoint, PointTrackingMode, PositionAffinity, ITextSnapshot)

Maps a position in the current snapshot of a buffer that is a member of the buffer graph to the specified snapshot.

public Nullable<Microsoft.VisualStudio.Text.SnapshotPoint> MapUpToSnapshot (Microsoft.VisualStudio.Text.SnapshotPoint point, Microsoft.VisualStudio.Text.PointTrackingMode trackingMode, Microsoft.VisualStudio.Text.PositionAffinity affinity, Microsoft.VisualStudio.Text.ITextSnapshot targetSnapshot);
Parameters
point
SnapshotPoint

A point in some buffer in the IBufferGraph.

trackingMode
PointTrackingMode

How point is tracked to the current snapshot if necessary.

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.

targetSnapshot
ITextSnapshot

The snapshot to which to map.

Returns

The corresponding position in targetSnapshot, or null if the position does not map to targetSnapshot using this graph.

Exceptions

point.Snapshot is null.

trackingMode is not a valid PointTrackingMode, or affinity is not a valid PositionAffinity.

Applies to