In This Article

ITextPositionRangeCollection Interface

Provides the base requirements for a sorted TextPositionRange collection, with one of the entries marked as primary.

public interface ITextPositionRangeCollection : IEnumerable<TextPositionRange>, IEnumerable

Properties

Count

Gets the number of ranges in the collection.

int Count { get; }

Property Value

System.Int32:

The number of ranges in the collection.

IsBlock

Gets whether the ranges in the collection designate a special rectangular block.

bool IsBlock { get; }

Property Value

System.Boolean:

true if the ranges in the collection designate a special rectangular block; otherwise, false.

Item[Int32]

Gets the child TextPositionRange at the specified index.

TextPositionRange this[int index] { get; }
Parameter Type Description
index System.Int32

The zero-based index of the child TextPositionRange.

Property Value

TextPositionRange:

The child TextPositionRange at the specified index.

Primary

Gets the TextPositionRange that is the primary one.

TextPositionRange Primary { get; }

Property Value

TextPositionRange:

The TextPositionRange that is the primary one.

PrimaryIndex

Gets the index of the primary TextPositionRange within the collection.

int PrimaryIndex { get; }

Property Value

System.Int32:

The index of the primary TextPositionRange within the collection.

Methods

BinarySearch(TextPosition)

Performs a binary search for the specified value.

int BinarySearch(TextPosition value)
Parameter Type Description
value TextPosition

The value for which to search.

Returns

System.Int32:

The index of the specified value in the specified array, if value is found. If value is not found and value is less than one or more elements in array, a negative number which is the bitwise complement of the index of the first element that is larger than value. If value is not found and value is greater than any of the elements in array, a negative number which is the bitwise complement of (the index of the last element plus 1).