skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class Selection

Represents a selection information.

Inheritance
System.Object
Selection
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.WinForms.Controls.SyntaxEditor.UI
Assembly: Telerik.WinControls.SyntaxEditor.dll

Syntax

public class Selection : IDisposable

Properties

ActivePosition

Gets the active position.

Declaration
public CaretPosition ActivePosition { get; }
Property Value
CaretPosition

The active position.

AnchoredPosition

Gets the anchored position.

Declaration
public CaretPosition AnchoredPosition { get; }
Property Value
CaretPosition

The anchored position.

Document

Gets the document.

Declaration
public TextDocument Document { get; }
Property Value
TextDocument

The document.

EndPosition

Gets the end position.

Declaration
public CaretPosition EndPosition { get; }
Property Value
CaretPosition

The end position.

IsEmpty

Gets a value indicating whether this instance is empty.

Declaration
public bool IsEmpty { get; }
Property Value
System.Boolean

true if this instance is empty; otherwise, false.

IsReversed

Gets a value indicating whether this instance is reversed.

Declaration
public bool IsReversed { get; }
Property Value
System.Boolean

true if this instance is reversed; otherwise, false.

Mode

Gets or sets the mode.

Declaration
public TextSelectionMode Mode { get; set; }
Property Value
TextSelectionMode

The mode.

SelectedSpans

Gets the selected spans.

Declaration
public IEnumerable<Span> SelectedSpans { get; }
Property Value
System.Collections.Generic.IEnumerable<Span>

The selected spans.

StartPosition

Gets the start position.

Declaration
public CaretPosition StartPosition { get; }
Property Value
CaretPosition

The start position.

Methods

Clear()

Clears this instance.

Declaration
public void Clear()

ContainsPosition(CaretPosition, Boolean)

Determines whether the specified position contains position.

Declaration
public bool ContainsPosition(CaretPosition caretPosition, bool inclusive = true)
Parameters
CaretPosition caretPosition

System.Boolean inclusive

Returns
System.Boolean

CreateSelectionState(Boolean)

Creates the state of the selection.

Declaration
public SelectionState CreateSelectionState(bool anchorPositions)
Parameters
System.Boolean anchorPositions

If set to true [anchor positions].

Returns
SelectionState

SelectionState.

Dispose()

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

Declaration
public void Dispose()
Implements
System.IDisposable.Dispose()

Dispose(Boolean)

Releases unmanaged and - optionally - managed resources.

Declaration
protected virtual void Dispose(bool disposing)
Parameters
System.Boolean disposing

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

GetSelectedText()

Gets the selected text.

Declaration
public string GetSelectedText()
Returns
System.String

System.String.

OnPreviewDragDrop(PreviewDragDropEventArgs)

Declaration
protected virtual void OnPreviewDragDrop(PreviewDragDropEventArgs args)
Parameters
PreviewDragDropEventArgs args

OnPreviewDragOver(PreviewDragOverEventArgs)

Declaration
protected virtual void OnPreviewDragOver(PreviewDragOverEventArgs args)
Parameters
PreviewDragOverEventArgs args

OnPreviewDragStart(PreviewDragStartEventArgs)

Declaration
protected virtual void OnPreviewDragStart(PreviewDragStartEventArgs args)
Parameters
PreviewDragStartEventArgs args

OnSelectionChanged()

Called when [selection changed].

Declaration
protected virtual void OnSelectionChanged()

OnSelectionChanging()

Called when [selection changing].

Declaration
protected virtual void OnSelectionChanging()

RestoreSelectionState(SelectionState)

Restores the state of the selection.

Declaration
public void RestoreSelectionState(SelectionState selectionState)
Parameters
SelectionState selectionState

State of the selection.

Select(CaretPosition, CaretPosition)

Selects the specified start position.

Declaration
public void Select(CaretPosition startPosition, CaretPosition endPosition)
Parameters
CaretPosition startPosition

CaretPosition endPosition

Select(Span)

Selects the specified span.

Declaration
public void Select(Span span)
Parameters
Span span

The span.

Select(Span, Boolean)

Selects the specified span.

Declaration
public void Select(Span span, bool isReversed)
Parameters
Span span

System.Boolean isReversed

SelectAll()

Selects all.

Declaration
public void SelectAll()

SetSelectionEnd(CaretPosition)

Sets the selection end.

Declaration
public void SetSelectionEnd(CaretPosition endPosition)
Parameters
CaretPosition endPosition

The end position.

SetSelectionStart(CaretPosition)

Sets the selection start.

Declaration
public void SetSelectionStart(CaretPosition startPosition)
Parameters
CaretPosition startPosition

The start position.

ToString()

Returns a System.String that represents this instance.

Declaration
public override string ToString()
Returns
System.String

A System.String that represents this instance.

Overrides
System.Object.ToString()

Events

PreviewDragDrop

Occurs upon releasing the mouse and dropping the selection.

Declaration
public event EventHandler<PreviewDragDropEventArgs> PreviewDragDrop
Event Type
System.EventHandler<PreviewDragDropEventArgs>

PreviewDragOver

Occurs upon moving the selection over the document.

Declaration
public event EventHandler<PreviewDragOverEventArgs> PreviewDragOver
Event Type
System.EventHandler<PreviewDragOverEventArgs>

PreviewDragStart

Occurs when selection dragging is about to be started.

Declaration
public event EventHandler<PreviewDragStartEventArgs> PreviewDragStart
Event Type
System.EventHandler<PreviewDragStartEventArgs>

SelectionChanged

Occurs when [selection changed].

Declaration
public event EventHandler SelectionChanged
Event Type
System.EventHandler

SelectionChanging

Occurs when [selection changing].

Declaration
public event EventHandler SelectionChanging
Event Type
System.EventHandler

Extension Methods

SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.