ITextSelection Interface
Represents the selected text in an ITextView.
Namespace: Microsoft.VisualStudio.Text.Editor
Assembly: Microsoft.VisualStudio.Text.UI (in Microsoft.VisualStudio.Text.UI.dll)
Syntax
'宣告
Public Interface ITextSelection
public interface ITextSelection
public interface class ITextSelection
type ITextSelection = interface end
public interface ITextSelection
The ITextSelection type exposes the following members.
Properties
Name | Description | |
---|---|---|
ActivationTracksFocus | Determines whether IsActive should track when the ITextView gains and loses aggregate focus. The default is true. | |
ActivePoint | Gets the active point of the selection. | |
AnchorPoint | Gets the anchor point of the selection. | |
End | Gets the end point of the selection. | |
IsActive | Whether or not the selection is active. | |
IsEmpty | Determines whether the selection is zero length. | |
IsReversed | Determines whether the active point is Span.Start and the anchor point is Span.End. | |
Mode | Gets or sets the selection mode. | |
SelectedSpans | The currently-selected spans. | |
Start | Gets the start point of the selection. | |
StreamSelectionSpan | Gets the current selection as if it were a stream selection, regardless of the current selection mode. | |
TextView | Gets the text view to which this selection belongs. | |
VirtualSelectedSpans | The currently-selected spans, as VirtualSnapshotSpan objects. |
Top
Methods
Name | Description | |
---|---|---|
Clear | Makes the selection zero length, with a start and end position at the logical end of the current selection. | |
GetSelectionOnTextViewLine | Get the selection on the specified ITextViewLine. | |
Select(SnapshotSpan, Boolean) | Selects the text in the specified selection span. | |
Select(VirtualSnapshotPoint, VirtualSnapshotPoint) | Selects the text between the two VirtualSnapshotPoint objects. |
Top
Events
Name | Description | |
---|---|---|
SelectionChanged | Occurs when Select or Clear are called, as well as when the selection is empty and the caret is moved. The sender of the event is this ITextSelection. |
Top