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