Class
SelectionRangeCollection

Represents a collection of selection ranges in a document.

Definition

Namespace:Telerik.Windows.Documents.Selection

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public class SelectionRangeCollection : ICollection<SelectionRange>, IEnumerable<SelectionRange>, IEnumerable

Inheritance: objectSelectionRangeCollection

Implements: ICollection<SelectionRange>IEnumerableIEnumerable<SelectionRange>

Constructors

SelectionRangeCollection()

Declaration

cs-api-definition
public SelectionRangeCollection()

Properties

Count

Gets the number of selection ranges in the collection.

Declaration

cs-api-definition
public int Count { get; }

Property Value

int

Implements ICollection<SelectionRange>.Count

First

Gets the first selection range in the collection.

Declaration

cs-api-definition
public SelectionRange First { get; }

Property Value

SelectionRange

IsReadOnly

Gets a value indicating whether the selection range collection is read-only.

Declaration

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

Property Value

bool

Implements ICollection<SelectionRange>.IsReadOnly

Last

Gets the last selection range in the collection.

Declaration

cs-api-definition
public SelectionRange Last { get; }

Property Value

SelectionRange

Methods

Add(SelectionRange)

Adds a new selection range to the collection.

Declaration

cs-api-definition
public void Add(SelectionRange item)

Parameters

item

SelectionRange

The selection range to be added to the collection.

Implements ICollection<SelectionRange>.Add(SelectionRange)

Clear()

Removes all selections from the SelectionRangeCollection.

Declaration

cs-api-definition
public void Clear()

Implements ICollection<SelectionRange>.Clear()

Remarks

This method clears the current collection of selected ranges, effectively resetting the selection.

Contains(SelectionRange)

Determines whether the specified selection range is contained within the collection.

Declaration

cs-api-definition
public bool Contains(SelectionRange item)

Parameters

item

SelectionRange

The selection range to check for containment.

Returns

bool

True if the collection contains the specified selection range; otherwise, false.

Implements ICollection<SelectionRange>.Contains(SelectionRange)

CopyTo(SelectionRange[], int)

Copies the elements of the current SelectionRangeCollection to a specified array, starting at a particular array index.

Declaration

cs-api-definition
public void CopyTo(SelectionRange[] array, int arrayIndex)

Parameters

array

SelectionRange[]

The one-dimensional array that is the destination of the elements copied from the SelectionRangeCollection. The array must have zero-based indexing.

arrayIndex

int

The zero-based index in the destination array at which storing the copied elements begins.

Implements ICollection<SelectionRange>.CopyTo(SelectionRange[], int)

GetEnumerator()

Returns an enumerator that iterates through the selection range collection.

Declaration

cs-api-definition
public IEnumerator<SelectionRange> GetEnumerator()

Returns

IEnumerator<SelectionRange>

An enumerator that can be used to iterate through the SelectionRangeCollection.

Implements IEnumerable<SelectionRange>.GetEnumerator()

Remove(SelectionRange)

Removes a specified selection range from the collection.

Declaration

cs-api-definition
public bool Remove(SelectionRange item)

Parameters

item

SelectionRange

The selection range to be removed from the collection.

Returns

bool

Returns a boolean indicating whether the removal was successful.

Implements ICollection<SelectionRange>.Remove(SelectionRange)

SortDescending()

Sorts the collection of selection ranges in descending order.

Declaration

cs-api-definition
public SelectionRangeCollection SortDescending()

Returns

SelectionRangeCollection

A collection of selection ranges sorted in descending order.