Selection Constructors

Definition

Overloads

Selection(SnapshotPoint, PositionAffinity)

Instantiates a new Selection with a zero-width extent at the provided insertion point.

Selection(SnapshotPoint, SnapshotPoint)

Instantiates a new Selection with the given anchor and active points, and the insertion point is located at the active point.

Selection(SnapshotSpan, Boolean)

Instantiates a new Selection with the given extent. Anchor and active points are defined by isReversed, and the insertion point is located at the active point.

Selection(VirtualSnapshotPoint, PositionAffinity)

Instantiates a new Selection with a zero-width extent at the provided insertion point.

Selection(VirtualSnapshotPoint, VirtualSnapshotPoint)

Instantiates a new Selection with the given anchor and active points, and the insertion point is located at the active point.

Selection(VirtualSnapshotSpan, Boolean)

Instantiates a new Selection with the given extent. Anchor and active points are defined by isReversed, and the insertion point is located at the active point.

Selection(SnapshotPoint, SnapshotPoint, SnapshotPoint, PositionAffinity)

Instantiates a new Selection.

Selection(VirtualSnapshotPoint, VirtualSnapshotPoint, VirtualSnapshotPoint, PositionAffinity)

Instantiates a new Selection.

Selection(SnapshotPoint, PositionAffinity)

Instantiates a new Selection with a zero-width extent at the provided insertion point.

public Selection (Microsoft.VisualStudio.Text.SnapshotPoint insertionPoint, Microsoft.VisualStudio.Text.PositionAffinity insertionPointAffinity = Microsoft.VisualStudio.Text.PositionAffinity.Successor);
new Microsoft.VisualStudio.Text.Selection : Microsoft.VisualStudio.Text.SnapshotPoint * Microsoft.VisualStudio.Text.PositionAffinity -> Microsoft.VisualStudio.Text.Selection
Public Sub New (insertionPoint As SnapshotPoint, Optional insertionPointAffinity As PositionAffinity = Microsoft.VisualStudio.Text.PositionAffinity.Successor)

Parameters

insertionPoint
SnapshotPoint

The location where a caret should be rendered and edits performed.

insertionPointAffinity
PositionAffinity

The affinity of the insertion point. This is used in places like word-wrap where one buffer position can represent both the end of one line and the beginning of the next.

Applies to

Selection(SnapshotPoint, SnapshotPoint)

Instantiates a new Selection with the given anchor and active points, and the insertion point is located at the active point.

public:
 Selection(Microsoft::VisualStudio::Text::SnapshotPoint anchorPoint, Microsoft::VisualStudio::Text::SnapshotPoint activePoint);
public Selection (Microsoft.VisualStudio.Text.SnapshotPoint anchorPoint, Microsoft.VisualStudio.Text.SnapshotPoint activePoint);
new Microsoft.VisualStudio.Text.Selection : Microsoft.VisualStudio.Text.SnapshotPoint * Microsoft.VisualStudio.Text.SnapshotPoint -> Microsoft.VisualStudio.Text.Selection
Public Sub New (anchorPoint As SnapshotPoint, activePoint As SnapshotPoint)

Parameters

anchorPoint
SnapshotPoint

The location of the fixed selection endpoint, meaning if a user were to hold shift and click, this point would remain where it is.

activePoint
SnapshotPoint

location of the movable selection endpoint, meaning if a user were to hold shift and click, this point would be changed to the location of the click.

Applies to

Selection(SnapshotSpan, Boolean)

Instantiates a new Selection with the given extent. Anchor and active points are defined by isReversed, and the insertion point is located at the active point.

public Selection (Microsoft.VisualStudio.Text.SnapshotSpan extent, bool isReversed = false);
new Microsoft.VisualStudio.Text.Selection : Microsoft.VisualStudio.Text.SnapshotSpan * bool -> Microsoft.VisualStudio.Text.Selection
Public Sub New (extent As SnapshotSpan, Optional isReversed As Boolean = false)

Parameters

extent
SnapshotSpan

The span that the selection covers.

isReversed
Boolean

True implies that ActivePoint comes before AnchorPoint. The InsertionPoint is set to the ActivePoint. InsertionPointAffinity is set to Predecessor when isReversed is true. Successor otherwise.

Applies to

Selection(VirtualSnapshotPoint, PositionAffinity)

Instantiates a new Selection with a zero-width extent at the provided insertion point.

public Selection (Microsoft.VisualStudio.Text.VirtualSnapshotPoint insertionPoint, Microsoft.VisualStudio.Text.PositionAffinity insertionPointAffinity = Microsoft.VisualStudio.Text.PositionAffinity.Successor);
new Microsoft.VisualStudio.Text.Selection : Microsoft.VisualStudio.Text.VirtualSnapshotPoint * Microsoft.VisualStudio.Text.PositionAffinity -> Microsoft.VisualStudio.Text.Selection
Public Sub New (insertionPoint As VirtualSnapshotPoint, Optional insertionPointAffinity As PositionAffinity = Microsoft.VisualStudio.Text.PositionAffinity.Successor)

Parameters

insertionPoint
VirtualSnapshotPoint

The location where a caret should be rendered and edits performed.

insertionPointAffinity
PositionAffinity

The affinity of the insertion point. This is used in places like word-wrap where one buffer position can represent both the end of one line and the beginning of the next.

Applies to

Selection(VirtualSnapshotPoint, VirtualSnapshotPoint)

Instantiates a new Selection with the given anchor and active points, and the insertion point is located at the active point.

public:
 Selection(Microsoft::VisualStudio::Text::VirtualSnapshotPoint anchorPoint, Microsoft::VisualStudio::Text::VirtualSnapshotPoint activePoint);
public Selection (Microsoft.VisualStudio.Text.VirtualSnapshotPoint anchorPoint, Microsoft.VisualStudio.Text.VirtualSnapshotPoint activePoint);
new Microsoft.VisualStudio.Text.Selection : Microsoft.VisualStudio.Text.VirtualSnapshotPoint * Microsoft.VisualStudio.Text.VirtualSnapshotPoint -> Microsoft.VisualStudio.Text.Selection
Public Sub New (anchorPoint As VirtualSnapshotPoint, activePoint As VirtualSnapshotPoint)

Parameters

anchorPoint
VirtualSnapshotPoint

The location of the fixed selection endpoint, meaning if a user were to hold shift and click, this point would remain where it is.

activePoint
VirtualSnapshotPoint

location of the movable selection endpoint, meaning if a user were to hold shift and click, this point would be changed to the location of the click.

Applies to

Selection(VirtualSnapshotSpan, Boolean)

Instantiates a new Selection with the given extent. Anchor and active points are defined by isReversed, and the insertion point is located at the active point.

public Selection (Microsoft.VisualStudio.Text.VirtualSnapshotSpan extent, bool isReversed = false);
new Microsoft.VisualStudio.Text.Selection : Microsoft.VisualStudio.Text.VirtualSnapshotSpan * bool -> Microsoft.VisualStudio.Text.Selection
Public Sub New (extent As VirtualSnapshotSpan, Optional isReversed As Boolean = false)

Parameters

extent
VirtualSnapshotSpan

The span that the selection covers.

isReversed
Boolean

True implies that ActivePoint comes before AnchorPoint. The InsertionPoint is set to the ActivePoint. InsertionPointAffinity is set to Predecessor when isReversed is true. Successor otherwise.

Applies to

Selection(SnapshotPoint, SnapshotPoint, SnapshotPoint, PositionAffinity)

Instantiates a new Selection.

public Selection (Microsoft.VisualStudio.Text.SnapshotPoint insertionPoint, Microsoft.VisualStudio.Text.SnapshotPoint anchorPoint, Microsoft.VisualStudio.Text.SnapshotPoint activePoint, Microsoft.VisualStudio.Text.PositionAffinity insertionPointAffinity = Microsoft.VisualStudio.Text.PositionAffinity.Successor);
new Microsoft.VisualStudio.Text.Selection : Microsoft.VisualStudio.Text.SnapshotPoint * Microsoft.VisualStudio.Text.SnapshotPoint * Microsoft.VisualStudio.Text.SnapshotPoint * Microsoft.VisualStudio.Text.PositionAffinity -> Microsoft.VisualStudio.Text.Selection
Public Sub New (insertionPoint As SnapshotPoint, anchorPoint As SnapshotPoint, activePoint As SnapshotPoint, Optional insertionPointAffinity As PositionAffinity = Microsoft.VisualStudio.Text.PositionAffinity.Successor)

Parameters

insertionPoint
SnapshotPoint

The location where a caret should be rendered and edits performed.

anchorPoint
SnapshotPoint

The location of the fixed selection endpoint, meaning if a user were to hold shift and click, this point would remain where it is.

activePoint
SnapshotPoint

location of the movable selection endpoint, meaning if a user were to hold shift and click, this point would be changed to the location of the click.

insertionPointAffinity
PositionAffinity

The affinity of the insertion point. This is used in places like word-wrap where one buffer position can represent both the end of one line and the beginning of the next.

Applies to

Selection(VirtualSnapshotPoint, VirtualSnapshotPoint, VirtualSnapshotPoint, PositionAffinity)

Instantiates a new Selection.

public Selection (Microsoft.VisualStudio.Text.VirtualSnapshotPoint insertionPoint, Microsoft.VisualStudio.Text.VirtualSnapshotPoint anchorPoint, Microsoft.VisualStudio.Text.VirtualSnapshotPoint activePoint, Microsoft.VisualStudio.Text.PositionAffinity insertionPointAffinity = Microsoft.VisualStudio.Text.PositionAffinity.Successor);
new Microsoft.VisualStudio.Text.Selection : Microsoft.VisualStudio.Text.VirtualSnapshotPoint * Microsoft.VisualStudio.Text.VirtualSnapshotPoint * Microsoft.VisualStudio.Text.VirtualSnapshotPoint * Microsoft.VisualStudio.Text.PositionAffinity -> Microsoft.VisualStudio.Text.Selection
Public Sub New (insertionPoint As VirtualSnapshotPoint, anchorPoint As VirtualSnapshotPoint, activePoint As VirtualSnapshotPoint, Optional insertionPointAffinity As PositionAffinity = Microsoft.VisualStudio.Text.PositionAffinity.Successor)

Parameters

insertionPoint
VirtualSnapshotPoint

The location where a caret should be rendered and edits performed.

anchorPoint
VirtualSnapshotPoint

The location of the fixed selection endpoint, meaning if a user were to hold shift and click, this point would remain where it is.

activePoint
VirtualSnapshotPoint

location of the movable selection endpoint, meaning if a user were to hold shift and click, this point would be changed to the location of the click.

insertionPointAffinity
PositionAffinity

The affinity of the insertion point. This is used in places like word-wrap where one buffer position can represent both the end of one line and the beginning of the next.

Applies to