Class ContentPosition
Represents a cursor position in a document story.
Inherited Members
Namespace: DRIT.Document
Assembly: DRIT.Document.dll
Syntax
public sealed class ContentPosition
Properties
Offset
Gets the zero-based offset in the story's flattened text.
Declaration
public int Offset { get; }
Property Value
| Type | Description |
|---|---|
| int |
Parent
Gets the run or paragraph containing this position.
Declaration
public Node Parent { get; }
Property Value
| Type | Description |
|---|---|
| Node |
Methods
Equals(object)
Determines whether another position identifies the same document story and offset.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with this position. |
Returns
| Type | Description |
|---|---|
| bool | true when both positions are equivalent. |
Overrides
GetHashCode()
Returns a hash code for this position.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code based on the document, story, and offset. |
Overrides
InsertRange(ContentRange)
Inserts the text of a range at this position.
Declaration
public ContentPosition InsertRange(ContentRange range)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentRange | range | The range whose text should be inserted. |
Returns
| Type | Description |
|---|---|
| ContentPosition | The position immediately after the inserted text. |
InsertText(string)
Inserts plain text at this position.
Declaration
public ContentPosition InsertText(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text to insert. |
Returns
| Type | Description |
|---|---|
| ContentPosition | The position immediately after the inserted text. |
LoadText(string)
Inserts plain text at this position.
Declaration
public ContentPosition LoadText(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text to insert. |
Returns
| Type | Description |
|---|---|
| ContentPosition | The position immediately after the inserted text. |
ToString()
Returns the position offset as text.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | The zero-based offset. |