ClassSelectionRangeCollection
Represents a collection of selection ranges in a document.
Definition
Namespace:Telerik.Windows.Documents.Selection
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public class SelectionRangeCollection : ICollection<SelectionRange>, IEnumerable<SelectionRange>, IEnumerable
Inheritance: objectSelectionRangeCollection
Implements:
Constructors
SelectionRangeCollection()
Declaration
public SelectionRangeCollection()
Properties
Count
Gets the number of selection ranges in the collection.
First
Gets the first selection range in the collection.
IsReadOnly
Gets a value indicating whether the selection range collection is read-only.
Last
Gets the last selection range in the collection.
Methods
Add(SelectionRange)
Adds a new selection range to the collection.
Declaration
public void Add(SelectionRange item)
Parameters
item
The selection range to be added to the collection.
Implements
Clear()
Removes all selections from the SelectionRangeCollection.
Declaration
public void Clear()
Implements
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
public bool Contains(SelectionRange item)
Parameters
item
The selection range to check for containment.
Returns
True if the collection contains the specified selection range; otherwise, false.
Implements
CopyTo(SelectionRange[], int)
Copies the elements of the current SelectionRangeCollection to a specified array, starting at a particular array index.
Declaration
public void CopyTo(SelectionRange[] array, int arrayIndex)
Parameters
array
The one-dimensional array that is the destination of the elements copied from the SelectionRangeCollection. The array must have zero-based indexing.
arrayIndex
The zero-based index in the destination array at which storing the copied elements begins.
Implements
GetEnumerator()
Returns an enumerator that iterates through the selection range collection.
Declaration
public IEnumerator<SelectionRange> GetEnumerator()
Returns
An enumerator that can be used to iterate through the SelectionRangeCollection.
Implements
Remove(SelectionRange)
Removes a specified selection range from the collection.
Declaration
public bool Remove(SelectionRange item)
Parameters
item
The selection range to be removed from the collection.
Returns
Returns a boolean indicating whether the removal was successful.
Implements
SortDescending()
Sorts the collection of selection ranges in descending order.
Declaration
public SelectionRangeCollection SortDescending()
Returns
A collection of selection ranges sorted in descending order.