Class
Selection

Represents a selection information.

Definition

Namespace:Telerik.Windows.Controls.SyntaxEditor.UI

Assembly:Telerik.Windows.Controls.SyntaxEditor.dll

Syntax:

cs-api-definition
public class Selection : IDisposable

Inheritance: objectSelection

Implements: IDisposable

Properties

ActivePosition

Gets the active position.

Declaration

cs-api-definition
public CaretPosition ActivePosition { get; }

Property Value

CaretPosition

The active position.

AnchoredPosition

Gets the anchored position.

Declaration

cs-api-definition
public CaretPosition AnchoredPosition { get; }

Property Value

CaretPosition

The anchored position.

Document

Gets the document.

Declaration

cs-api-definition
public TextDocument Document { get; }

Property Value

TextDocument

The document.

EndPosition

Gets the end position.

Declaration

cs-api-definition
public CaretPosition EndPosition { get; }

Property Value

CaretPosition

The end position.

IsEmpty

Gets a value indicating whether this instance is empty.

Declaration

cs-api-definition
public bool IsEmpty { get; }

Property Value

bool

true if this instance is empty; otherwise, false.

IsReversed

Gets a value indicating whether this instance is reversed.

Declaration

cs-api-definition
public bool IsReversed { get; }

Property Value

bool

true if this instance is reversed; otherwise, false.

Mode

Gets or sets the mode.

Declaration

cs-api-definition
public TextSelectionMode Mode { get; set; }

Property Value

TextSelectionMode

The mode.

SelectedSpans

Gets the selected spans.

Declaration

cs-api-definition
public IEnumerable<Span> SelectedSpans { get; }

Property Value

IEnumerable<Span>

The selected spans.

StartPosition

Gets the start position.

Declaration

cs-api-definition
public CaretPosition StartPosition { get; }

Property Value

CaretPosition

The start position.

Methods

Clear()

Clears this instance.

Declaration

cs-api-definition
public void Clear()

ContainsPosition(CaretPosition, bool)

Determines whether the specified position contains position.

Declaration

cs-api-definition
public bool ContainsPosition(CaretPosition caretPosition, bool inclusive = true)

Parameters

caretPosition

CaretPosition

inclusive

bool

Returns

bool

CreateSelectionState(bool)

Creates the state of the selection.

Declaration

cs-api-definition
public SelectionState CreateSelectionState(bool anchorPositions)

Parameters

anchorPositions

bool

If set to true [anchor positions].

Returns

SelectionState

SelectionState.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration

cs-api-definition
public void Dispose()

Implements IDisposable.Dispose()

Dispose(bool)

Releases unmanaged and - optionally - managed resources.

Declaration

cs-api-definition
protected virtual void Dispose(bool disposing)

Parameters

disposing

bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

GetSelectedText()

Gets the selected text.

Declaration

cs-api-definition
public string GetSelectedText()

Returns

string

System.String.

OnSelectionChanged()

Called when [selection changed].

Declaration

cs-api-definition
protected virtual void OnSelectionChanged()

OnSelectionChanging()

Called when [selection changing].

Declaration

cs-api-definition
protected virtual void OnSelectionChanging()

RestoreSelectionState(SelectionState)

Restores the state of the selection.

Declaration

cs-api-definition
public void RestoreSelectionState(SelectionState selectionState)

Parameters

selectionState

SelectionState

State of the selection.

Select(CaretPosition, CaretPosition)

Selects the specified start position.

Declaration

cs-api-definition
public void Select(CaretPosition startPosition, CaretPosition endPosition)

Parameters

startPosition

CaretPosition

endPosition

CaretPosition

Select(Span)

Selects the specified span.

Declaration

cs-api-definition
public void Select(Span span)

Parameters

span

Span

The span.

Select(Span, bool)

Selects the specified span.

Declaration

cs-api-definition
public void Select(Span span, bool isReversed)

Parameters

span

Span

isReversed

bool

SelectAll()

Selects all.

Declaration

cs-api-definition
public void SelectAll()

SetSelectionEnd(CaretPosition)

Sets the selection end.

Declaration

cs-api-definition
public void SetSelectionEnd(CaretPosition endPosition)

Parameters

endPosition

CaretPosition

The end position.

SetSelectionStart(CaretPosition)

Sets the selection start.

Declaration

cs-api-definition
public void SetSelectionStart(CaretPosition startPosition)

Parameters

startPosition

CaretPosition

The start position.

ToString()

Returns a string that represents this instance.

Declaration

cs-api-definition
public override string ToString()

Returns

string

A string that represents this instance.

Overrides object.ToString()

Events

SelectionChanged

Occurs when [selection changed].

Declaration

cs-api-definition
public event EventHandler SelectionChanged

Event Value

EventHandler

SelectionChanging

Occurs when [selection changing].

Declaration

cs-api-definition
public event EventHandler SelectionChanging

Event Value

EventHandler