skip navigation
  • Product Bundles

    DevCraft

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

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

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

    Mobile

    UI for .NET MAUI UI for Xamarin

    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 Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    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 and Security
    • 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
Namespace: Telerik.Windows.Controls.SyntaxEditor.UI
Assembly: Telerik.Windows.Controls.SyntaxEditor.dll

Syntax

public class Selection : Object, 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()

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.

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.

Events

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

CollectionExtensions.ToEnumerable<T>(T)
EnumerableExtensions.ToEnumerable<T>(T)
Getting Started
  • Install Now
  • Demos
  • SDK Samples Browser
  • Sample Applications
Support Resources
  • Code Library
  • Knowledge Base
  • MVVM Support
  • Videos
  • GitHub SDK Repository
Community
  • Forums
  • Blogs
  • XAML 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.

OSZAR »