New to Telerik UI for WinFormsStart a free 30-day trial

Represents a selection information.

Definition

Namespace:Telerik.WinForms.Controls.SyntaxEditor.UI

Assembly:Telerik.WinControls.SyntaxEditor.dll

Syntax:

C#
public class Selection : IDisposable

Inheritance: objectSelection

Implements: IDisposable

Properties

Gets the active position.

C#
public CaretPosition ActivePosition { get; }
Property Value:

The active position.

Gets the anchored position.

C#
public CaretPosition AnchoredPosition { get; }
Property Value:

The anchored position.

Gets the document.

C#
public TextDocument Document { get; }
Property Value:

The document.

Gets the end position.

C#
public CaretPosition EndPosition { get; }
Property Value:

The end position.

Gets a value indicating whether this instance is empty.

C#
public bool IsEmpty { get; }
Property Value:

true if this instance is empty; otherwise, false.

Gets a value indicating whether this instance is reversed.

C#
public bool IsReversed { get; }
Property Value:

true if this instance is reversed; otherwise, false.

Gets or sets the mode.

C#
public TextSelectionMode Mode { get; set; }
Property Value:

The mode.

SelectedSpans

IEnumerable<Span>

Gets the selected spans.

C#
public IEnumerable<Span> SelectedSpans { get; }
Property Value:

The selected spans.

Gets the start position.

C#
public CaretPosition StartPosition { get; }
Property Value:

The start position.

Methods

Clears this instance.

C#
public void Clear()

Determines whether the specified position contains position.

C#
public bool ContainsPosition(CaretPosition caretPosition, bool inclusive = true)
Parameters:caretPositionCaretPositioninclusiveboolReturns:

bool

Creates the state of the selection.

C#
public SelectionState CreateSelectionState(bool anchorPositions)
Parameters:anchorPositionsbool

If set to true [anchor positions].

Returns:

SelectionState

SelectionState.

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

C#
public void Dispose()

Implements: IDisposable.Dispose()

Releases unmanaged and - optionally - managed resources.

C#
protected virtual void Dispose(bool disposing)
Parameters:disposingbool

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

Gets the selected text.

C#
public string GetSelectedText()
Returns:

string

System.String.

C#
protected virtual void OnPreviewDragDrop(PreviewDragDropEventArgs args)
Parameters:argsPreviewDragDropEventArgs
C#
protected virtual void OnPreviewDragOver(PreviewDragOverEventArgs args)
Parameters:argsPreviewDragOverEventArgs
C#
protected virtual void OnPreviewDragStart(PreviewDragStartEventArgs args)
Parameters:argsPreviewDragStartEventArgs

Called when [selection changed].

C#
protected virtual void OnSelectionChanged()

Called when [selection changing].

C#
protected virtual void OnSelectionChanging()

Restores the state of the selection.

C#
public void RestoreSelectionState(SelectionState selectionState)
Parameters:selectionStateSelectionState

State of the selection.

Selects the specified start position.

C#
public void Select(CaretPosition startPosition, CaretPosition endPosition)
Parameters:startPositionCaretPositionendPositionCaretPosition

Selects the specified span.

C#
public void Select(Span span, bool isReversed)
Parameters:spanSpanisReversedbool

Selects the specified span.

C#
public void Select(Span span)
Parameters:spanSpan

The span.

Selects all.

C#
public void SelectAll()

Sets the selection end.

C#
public void SetSelectionEnd(CaretPosition endPosition)
Parameters:endPositionCaretPosition

The end position.

Sets the selection start.

C#
public void SetSelectionStart(CaretPosition startPosition)
Parameters:startPositionCaretPosition

The start position.

Returns a string that represents this instance.

C#
public override string ToString()
Returns:

string

A string that represents this instance.

Overrides: object.ToString()

Events

Occurs upon releasing the mouse and dropping the selection.

C#
public event EventHandler<PreviewDragDropEventArgs> PreviewDragDrop

Occurs upon moving the selection over the document.

C#
public event EventHandler<PreviewDragOverEventArgs> PreviewDragOver

Occurs when selection dragging is about to be started.

C#
public event EventHandler<PreviewDragStartEventArgs> PreviewDragStart

Occurs when [selection changed].

C#
public event EventHandler SelectionChanged

Occurs when [selection changing].

C#
public event EventHandler SelectionChanging