Class RichTextSelectionSet
- Namespace
- RichEdit.Core
- Assembly
- RichEdit.Core.dll
A normalized set of directional text selections within one rich story.
public sealed record RichTextSelectionSet : RichSelection, IEquatable<RichSelection>, IReadOnlyList<RichTextSelectionItem>, IReadOnlyCollection<RichTextSelectionItem>, IEnumerable<RichTextSelectionItem>, IEnumerable, IEquatable<RichTextSelectionSet>
- Inheritance
-
RichTextSelectionSet
- Implements
- Inherited Members
Remarks
Object and table-cell selections remain separate structural selection kinds. This set contains no snapshot reference.
Constructors
RichTextSelectionSet(RichDocumentSnapshot, IEnumerable<RichTextSelectionItem>, int)
Validates and normalizes against a frozen snapshot. The primary index addresses the input enumeration before sorting.
public RichTextSelectionSet(RichDocumentSnapshot snapshot, IEnumerable<RichTextSelectionItem> selections, int primaryIndex = 0)
Parameters
snapshotRichDocumentSnapshotselectionsIEnumerable<RichTextSelectionItem>primaryIndexint
Properties
Count
Gets the number of elements in the collection.
public int Count { get; }
Property Value
- int
The number of elements in the collection.
this[int]
Gets the element at the specified index in the read-only list.
public RichTextSelectionItem this[int index] { get; }
Parameters
indexintThe zero-based index of the element to get.
Property Value
- RichTextSelectionItem
The element at the specified index in the read-only list.
Primary
Gets the selection represented by native selection and composition UI.
public RichTextSelectionItem Primary { get; }
Property Value
PrimaryIndex
Gets the primary selection's normalized index.
public int PrimaryIndex { get; }
Property Value
Methods
Equals(RichTextSelectionSet?)
Compares value-only selections and primary identity.
public bool Equals(RichTextSelectionSet? other)
Parameters
otherRichTextSelectionSet
Returns
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<RichTextSelectionItem> GetEnumerator()
Returns
- IEnumerator<RichTextSelectionItem>
An enumerator that can be used to iterate through the collection.
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.