The rather unusual text selection API.
Public Member Functions | |
void | removeRange (Range r) |
Removes a range from the selection. More... | |
void | selectAllChildren (Node node) |
Adds a range which selects all the kids of the given node. More... | |
void | removeAllRanges () |
Removes all ranges from the selection. More... | |
void | addRange (Range r) |
Adds a range to the selection. More... | |
Range | getRangeAt (int index) |
A range object representing one of the ranges currently selected. More... | |
override string | ToString () |
The currently selected text. More... | |
void | collapseToStart () |
Collapses the selection to the start of the range. More... | |
void | collapseToEnd () |
Collapses the selection to the end of the range. More... | |
void | collapse (bool toStart) |
Collapses the selection to the start or end of the range. More... | |
void | deleteFromDocument () |
Deletes the selection's content from the document. More... | |
bool | containsNode (Node n) |
Indicates if a certain node is part of the selection. More... | |
Public Attributes | |
List< Range > | Ranges =new List<Range>() |
<suummary>All ranges (oddly, it's required to be exactly 1, but addRange exists) More... | |
Package Functions | |
void | UpdateSelection (bool select, Range r) |
Selects/ Deselects a whole range. More... | |
Properties | |
Node | focusNode [get] |
Returns the Node in which the selection ends. More... | |
int | rangeCount [get] |
Returns the number of ranges in the selection More... | |
Node | anchorNode [get] |
Returns the Node in which the selection starts. More... | |
int | anchorOffset [get] |
Returns a number representing the offset of the selection's anchor within the anchorNode. If anchorNode is a text node, this is the number of characters within anchorNode preceding the anchor. If anchorNode is an element, this is the number of child nodes of the anchorNode preceding the anchor. More... | |
int | focusOffset [get] |
Returns a number representing the offset of the selection's anchor within the focusNode. If focusNode is a text node, this is the number of characters within focusNode preceding the focus. If focusNode is an element, this is the number of child nodes of the focusNode preceding the focus. More... | |
bool | isCollapsed [get] |
Returns a Boolean indicating whether the selection's start and end points are at the same position. More... | |
|
inline |
Adds a range to the selection.
|
inline |
Collapses the selection to the start or end of the range.
|
inline |
Collapses the selection to the end of the range.
|
inline |
Collapses the selection to the start of the range.
|
inline |
Indicates if a certain node is part of the selection.
|
inline |
Deletes the selection's content from the document.
|
inline |
A range object representing one of the ranges currently selected.
|
inline |
Removes all ranges from the selection.
|
inline |
Removes a range from the selection.
|
inline |
Adds a range which selects all the kids of the given node.
|
inline |
The currently selected text.
|
inlinepackage |
Selects/ Deselects a whole range.
<suummary>All ranges (oddly, it's required to be exactly 1, but addRange exists)
|
get |
Returns the Node in which the selection starts.
|
get |
Returns a number representing the offset of the selection's anchor within the anchorNode. If anchorNode is a text node, this is the number of characters within anchorNode preceding the anchor. If anchorNode is an element, this is the number of child nodes of the anchorNode preceding the anchor.
|
get |
Returns the Node in which the selection ends.
|
get |
Returns a number representing the offset of the selection's anchor within the focusNode. If focusNode is a text node, this is the number of characters within focusNode preceding the focus. If focusNode is an element, this is the number of child nodes of the focusNode preceding the focus.
|
get |
Returns a Boolean indicating whether the selection's start and end points are at the same position.
|
get |
Returns the number of ranges in the selection