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

Represents a collection of selection ranges in a document.

Definition

Namespace:Telerik.Windows.Documents.Selection

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

C#
public class SelectionRangeCollection : ICollection<SelectionRange>, IEnumerable<SelectionRange>, IEnumerable

Inheritance: objectSelectionRangeCollection

Implements: ICollection<SelectionRange>IEnumerableIEnumerable<SelectionRange>

Constructors

C#
public SelectionRangeCollection()

Properties

Gets the number of selection ranges in the collection.

C#
public int Count { get; }

Implements: ICollection<SelectionRange>.Count

Gets the first selection range in the collection.

C#
public SelectionRange First { get; }

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

C#
public bool IsReadOnly { get; }

Implements: ICollection<SelectionRange>.IsReadOnly

Gets the last selection range in the collection.

C#
public SelectionRange Last { get; }

Methods

Adds a new selection range to the collection.

C#
public void Add(SelectionRange item)
Parameters:itemSelectionRange

The selection range to be added to the collection.

Implements: ICollection<SelectionRange>.Add(SelectionRange)

Removes all selections from the SelectionRangeCollection.

C#
public void Clear()

Implements: ICollection<SelectionRange>.Clear()

Remarks:

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

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

C#
public bool Contains(SelectionRange item)
Parameters:itemSelectionRange

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)

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

C#
public void CopyTo(SelectionRange[] array, int arrayIndex)
Parameters:arraySelectionRange[]

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

arrayIndexint

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

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

Returns an enumerator that iterates through the selection range collection.

C#
public IEnumerator<SelectionRange> GetEnumerator()
Returns:

IEnumerator<SelectionRange>

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

Implements: IEnumerable<SelectionRange>.GetEnumerator()

Removes a specified selection range from the collection.

C#
public bool Remove(SelectionRange item)
Parameters:itemSelectionRange

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)

Sorts the collection of selection ranges in descending order.

C#
public SelectionRangeCollection SortDescending()
Returns:

SelectionRangeCollection

A collection of selection ranges sorted in descending order.