Table of Contents

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

snapshot RichDocumentSnapshot
selections IEnumerable<RichTextSelectionItem>
primaryIndex int

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

index int

The 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

RichTextSelectionItem

PrimaryIndex

Gets the primary selection's normalized index.

public int PrimaryIndex { get; }

Property Value

int

Methods

Equals(RichTextSelectionSet?)

Compares value-only selections and primary identity.

public bool Equals(RichTextSelectionSet? other)

Parameters

other RichTextSelectionSet

Returns

bool

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.