RichTextKit v0.4

TextRange Struct

Assembly: Topten.RichTextKit.dll
Namespace: Topten.RichTextKit

Represents a range of code points in a text document

public struct TextRange

Inheritance

TextRange → ValueTypeobject

Constructors

TextRange(CaretPosition)

Initializes a TextRange from a caret position

TextRange(int, bool)

Initializes a TextRange with a non-range position

TextRange(int, int, bool)

Initializes a TextRange

Fields

AltPosition

True if the end of the range should be displayed with the caret in the alt position

End

The code point index of the end of the range

Start

The code point index of the start of the range

Properties

CaretPosition

Gets the end of the range as a caret position

IsRange

Check if this is actually a range

Length

Get the length of this range

Maximum

Get the end of the range closer to the end of the document

Minimum

Get the end of the range closer to the start of the document

Normalized

Returns the normalized version of the text range

Reversed

Returns the reversed text range

Methods

Clamp(int)

Clamp the text range to a document length

IsEqual(TextRange)

Compare this text range to another for equality

Offset(int)

Offset this text range by the specified amount

Union(TextRange, TextRange)

Create a new range that is the union of two other ranges. The union is the smallest range that contains the other two other ranges.

UpdateForEdit(int, int, int)

Create an updated text range that tries to represent the same piece of text from before an edit to after the edit.

Overridden & Inherited

ToString()