Stores selection ranges and exposes valid ranges through its count, boundary properties, and enumerator.
Definition
Namespace:Telerik.WinForms.Documents.Selection
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public class SelectionRangeCollection : IEnumerable
Inheritance: objectSelectionRangeCollection
Implements:
Constructors
Initializes an empty collection of selection ranges.
public SelectionRangeCollection()
Properties
Gets the first valid range, or null if no valid range exists.
public SelectionRange First { get; }
Gets true because Add(SelectionRange) and Remove(SelectionRange) are not supported.
public bool IsReadOnly { get; }
Gets the last valid range, or null if no valid range exists.
public SelectionRange Last { get; }
Methods
This operation is not supported; ranges are managed by the owning selection.
public void Add(SelectionRange item)
The range that would be added.
Exceptions: InvalidOperationExceptionAlways thrown because this collection does not support adding ranges.
Removes all ranges and releases their document-position event subscriptions.
public void Clear()
Determines whether the collection stores the specified range instance, including invalid entries.
public bool Contains(SelectionRange item)
The range to locate.
Returns:Copies the valid ranges into an array, creating a copy of each range.
public void CopyTo(SelectionRange[] array, int arrayIndex)
The destination array.
arrayIndexintThe number of valid ranges to skip; copied ranges are written starting at destination index zero.
Exceptions: ArgumentExceptionThe destination array is shorter than the collection's valid range count.
Enumerates the valid ranges in their current collection order.
public IEnumerator<SelectionRange> GetEnumerator()
IEnumerator<SelectionRange>
An enumerator over valid selection ranges.
This operation is not supported; ranges are managed by the owning selection.
public bool Remove(SelectionRange item)
The range that would be removed.
Returns:This method does not return; it always throws.
Exceptions: InvalidOperationExceptionAlways thrown because this collection does not support removing individual ranges.
Sorts the stored ranges by descending start position and returns this collection.
public SelectionRangeCollection SortDescending()
This collection after sorting.