ITextSelection.SelectedSpans Property

Definition

The currently-selected spans.

public:
 property Microsoft::VisualStudio::Text::NormalizedSnapshotSpanCollection ^ SelectedSpans { Microsoft::VisualStudio::Text::NormalizedSnapshotSpanCollection ^ get(); };
public Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection SelectedSpans { get; }
member this.SelectedSpans : Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection
Public ReadOnly Property SelectedSpans As NormalizedSnapshotSpanCollection

Property Value

The currently-selected spans.

Remarks

This span collection will never be empty. However, the spans in this collection may be 0-length.

This value can be very expensive to compute the first time after the selection has changed.

Use GetSelectionOnTextViewLine() unless you need the entire selection.

Applies to