Class DocumentPosition
Represents position in Rad
Inheritance
Namespace: Telerik.Windows.Documents
Assembly: Telerik.Windows.Controls.RichTextBox.dll
Syntax
public class DocumentPosition : Object, IComparable<DocumentPosition>, IDisposable
Constructors
DocumentPosition(DocumentPosition)
Initializes a new instance of the DocumentPosition class.
Declaration
public DocumentPosition(DocumentPosition documentPosition)
Parameters
Document The document position to copy. |
DocumentPosition(DocumentPosition, Boolean)
Initializes a new instance of the DocumentPosition class.
Declaration
public DocumentPosition(DocumentPosition documentPosition, bool trackDocumentChangeEvents)
Parameters
Document The document position to copy. |
System. Indicates whether the position is anchored to the end of the word. If true, the position is kept between the same characters when there is a modification in the content before the position. |
DocumentPosition(DocumentLayoutBox)
Initializes a new instance of the DocumentPosition class.
Declaration
public DocumentPosition(DocumentLayoutBox documentBox)
Parameters
Document The Document |
DocumentPosition(DocumentLayoutBox, Boolean)
Initializes a new instance of the DocumentPosition class.
Declaration
public DocumentPosition(DocumentLayoutBox documentBox, bool trackDocumentChangeEvents)
Parameters
Document The Document |
System. Indicates whether the position is anchored to the end of the word. If true, the position is kept between the same characters when there is a modification in the content before the position. |
DocumentPosition(RadDocument)
Initializes a new instance of the DocumentPosition class.
Declaration
public DocumentPosition(RadDocument document)
Parameters
Rad An instance of Rad |
DocumentPosition(RadDocument, Boolean)
Initializes a new instance of the DocumentPosition class.
Declaration
public DocumentPosition(RadDocument document, bool trackDocumentChangeEvents)
Parameters
Rad An instance of Rad |
System. Indicates whether the position is anchored to the end of the word. If true, the position is kept between the same characters when there is a modification in the content before the position. |
Properties
IsPositionAtDocumentEnd
Determines whether the DocumentPosition is at the end of the document.
Declaration
public bool IsPositionAtDocumentEnd { get; }
Property Value
System.
|
IsPositionAtDocumentStart
Determines whether the DocumentPosition is at the start of the document.
Declaration
public bool IsPositionAtDocumentStart { get; }
Property Value
System.
|
IsPositionAtParagraphEnd
Determines whether the DocumentPosition is at the end of a Paragraph.
Declaration
public bool IsPositionAtParagraphEnd { get; }
Property Value
System.
|
IsPositionAtParagraphStart
Determines whether the DocumentPosition is at the start of a Paragraph.
Declaration
public bool IsPositionAtParagraphStart { get; }
Property Value
System.
|
IsPositionAtTableCellEnd
Determines whether the DocumentPosition is at the end of a Table
Declaration
public bool IsPositionAtTableCellEnd { get; }
Property Value
System.
|
IsPositionAtTableCellStart
Determines whether the DocumentPosition is at the start of a Table
Declaration
public bool IsPositionAtTableCellStart { get; }
Property Value
System.
|
IsPositionAtTableRowStart
Determines whether the DocumentPosition is at the start of a Table
Declaration
public bool IsPositionAtTableRowStart { get; }
Property Value
System.
|
IsPositionInsideTable
Gets a value indicating whether this position is inside table.
Declaration
public bool IsPositionInsideTable { get; }
Property Value
System.
|
Location
Gets a value representing the layout position of this document position.
Declaration
public PointF Location { get; }
Property Value
Methods
AnchorToCurrentBoxIndex()
Anchors the position to the current box index.
Declaration
public void AnchorToCurrentBoxIndex()
AnchorToNextFormattingSymbol()
Anchors the position to the next formatting symbol.
Declaration
public void AnchorToNextFormattingSymbol()
CompareTo(DocumentPosition)
Compares the current object with another object of the same type.
Declaration
public int CompareTo(DocumentPosition other)
Parameters
Document An object to compare with this object. |
Returns
System. A value that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the |
Dispose()
Disposes this DocumentPosition.
Declaration
public void Dispose()
Equals(Object)
Determines whether the specified System.
Declaration
public override bool Equals(object obj)
Parameters
System. The System. |
Returns
System.
|
FindFirstBoxForWord(InlineLayoutBox)
Finds the first box for word.
Declaration
public static InlineLayoutBox FindFirstBoxForWord(InlineLayoutBox inlineLayoutBox)
Parameters
Inline The inline layout box. |
Returns
FindLastBoxForWord(InlineLayoutBox)
Finds the last box for word.
Declaration
public static InlineLayoutBox FindLastBoxForWord(InlineLayoutBox inlineLayoutBox)
Parameters
Inline The inline layout box. |
Returns
GetCurrentInline()
GetCurrentInlineBox()
Gets the current Inline
Declaration
public InlineLayoutBox GetCurrentInlineBox()
Returns
Inline The current Inline |
GetCurrentParagraph()
GetCurrentParagraphBox()
Gets the current Paragraph
Declaration
public ParagraphLayoutBox GetCurrentParagraphBox()
Returns
Paragraph The current Paragraph |
GetCurrentSectionBox()
Gets the current Section
Declaration
public SectionLayoutBox GetCurrentSectionBox()
Returns
Section The current Section |
GetCurrentSpan()
GetCurrentSpanBox()
Gets the current Span
Declaration
public SpanLayoutBox GetCurrentSpanBox()
Returns
Span The current Span |
GetCurrentTable()
GetCurrentTableBox()
Gets the current Table
Declaration
public TableLayoutBox GetCurrentTableBox()
Returns
Table The current Table |
GetCurrentTableCell()
GetCurrentTableCellBox()
Gets the current Table
Declaration
public TableCellLayoutBox GetCurrentTableCellBox()
Returns
Table The current Table |
GetCurrentTableRow()
GetCurrentTableRowBox()
Gets the current Table
Declaration
public TableRowLayoutBox GetCurrentTableRowBox()
Returns
Table The current Table |
GetCurrentWord()
Gets the current word.
Declaration
public string GetCurrentWord()
Returns
System. The current word. |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
System. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
GetIndexInCurrentSpan()
Gets the index of the position in the current span.
Declaration
public int GetIndexInCurrentSpan()
Returns
System. The index of the position in the current span. |
GetIndexInCurrentSpanBox()
Gets the index of the position in the current Span
Declaration
public int GetIndexInCurrentSpanBox()
Returns
System. The index of the position in the current Span |
GetNextInline()
GetNextInlineBox()
Gets the next Inline
Declaration
public InlineLayoutBox GetNextInlineBox()
Returns
Inline The next Inline |
GetNextSpan()
Gets the next Span
Declaration
public SpanLayoutBox GetNextSpan()
Returns
Span The next Span |
GetNextSpanBox()
Gets the next Span
Declaration
public SpanLayoutBox GetNextSpanBox()
Returns
Span The next Span |
GetPreviousInline()
GetPreviousInlineBox()
Gets the previous Inline
Declaration
public InlineLayoutBox GetPreviousInlineBox()
Returns
Inline The previous Inline |
GetPreviousSpanBox()
Gets the previous Span
Declaration
public SpanLayoutBox GetPreviousSpanBox()
Returns
Span The previous Span |
MoveDown()
Moves the position down.
Declaration
public bool MoveDown()
Returns
System.
|
MoveToCurrentLineEnd()
Moves the position to the end of the current line.
Declaration
public bool MoveToCurrentLineEnd()
Returns
System.
|
MoveToCurrentLineStart()
Moves the position to the start of the current line.
Declaration
public bool MoveToCurrentLineStart()
Returns
System.
|
MoveToCurrentWordEnd()
Moves the position to the end of the current word.
Declaration
public void MoveToCurrentWordEnd()
MoveToCurrentWordStart()
Moves the position to the start of the current word.
Declaration
public void MoveToCurrentWordStart()
MoveToDocumentElementEnd(DocumentElement)
Moves the position to the end of a document element.
Declaration
public void MoveToDocumentElementEnd(DocumentElement element)
Parameters
Document The document element. |
MoveToDocumentElementStart(DocumentElement)
Moves the position to the start of a document element.
Declaration
public void MoveToDocumentElementStart(DocumentElement element)
Parameters
Document The document element. |
MoveToDocumentEnd()
Moves the position to the last position in the document.
Declaration
public void MoveToDocumentEnd()
MoveToDocumentStart()
Moves the position to the first position in the document.
Declaration
public void MoveToDocumentStart()
MoveToEndOfDocumentElement(DocumentElement)
Moves the position to the end of a document element.
Declaration
public void MoveToEndOfDocumentElement(DocumentElement element)
Parameters
Document The document element. |
MoveToFirstPositionInDocument()
Moves the position to the first position in the document.
Declaration
public void MoveToFirstPositionInDocument()
MoveToFirstPositionInNextParagraph()
Moves the position to the first position in the next paragraph.
Declaration
public void MoveToFirstPositionInNextParagraph()
MoveToFirstPositionInParagraph()
Moves the position to the first position in the current paragraph.
Declaration
public void MoveToFirstPositionInParagraph()
MoveToFirstPositionInPreviousParagraph()
Moves the position to the first position in the previous paragraph.
Declaration
public void MoveToFirstPositionInPreviousParagraph()
MoveToFirstPositionInTableCell()
Moves the position to the first position in the current table cell.
Declaration
public void MoveToFirstPositionInTableCell()
MoveToFirstPositionOnNextPage()
Moves the position to the first position on the next page.
Declaration
public void MoveToFirstPositionOnNextPage()
MoveToInline(InlineLayoutBox, Int32)
Moves the position to Inline
Declaration
public void MoveToInline(InlineLayoutBox inlineLayoutBox, int index)
Parameters
Inline The Inline |
System. The index in the Inline |
MoveToInline(Inline)
Moves the position to the start of an Inline.
Declaration
public void MoveToInline(Inline inline)
Parameters
Inline
inline
|
MoveToLastPositionInDocument()
Moves the position to the last position in the document.
Declaration
public void MoveToLastPositionInDocument()
MoveToLastPositionInParagraph()
Moves the position to the last position in the current paragraph.
Declaration
public void MoveToLastPositionInParagraph()
MoveToLastPositionInPreviousParagraph()
Moves the position to the last position in the previous paragraph.
Declaration
public void MoveToLastPositionInPreviousParagraph()
MoveToLastPositionInTableCell()
Moves the position to the last position in the current table cell.
Declaration
public void MoveToLastPositionInTableCell()
MoveToLastPositionOnPreviousPage()
Moves the position to the last position on the previous page.
Declaration
public void MoveToLastPositionOnPreviousPage()
MoveToNext()
Moves the position to the next possible position in the document.
Declaration
public bool MoveToNext()
Returns
System.
|
MoveToNextInline()
Moves the position to the next InlineLayoutBox.
Declaration
public bool MoveToNextInline()
Returns
System.
|
MoveToNextInlineBox()
Moves the position to the next InlineLayoutBox.
Declaration
public bool MoveToNextInlineBox()
Returns
System.
|
MoveToNextPageStart()
Moves the position to the first position on the next page.
Declaration
public void MoveToNextPageStart()
MoveToNextParagraphStart()
Moves the position to the first position in the next paragraph.
Declaration
public void MoveToNextParagraphStart()
MoveToNextSpanBox()
Moves the position to the next SpanLayoutBox.
Declaration
public bool MoveToNextSpanBox()
Returns
System.
|
MoveToNextWordStart()
Moves the position to the start of the next word.
Declaration
public bool MoveToNextWordStart()
Returns
System.
|
MoveToPage(Int32)
Moves the position to the start of a page.
Declaration
public void MoveToPage(int pageNumber)
Parameters
System. The number of the page the position should be moved to. |
MoveToParagraphEnd()
Moves the position to the last position in the current paragraph.
Declaration
public void MoveToParagraphEnd()
MoveToParagraphStart()
Moves the position to the first position in the current paragraph.
Declaration
public void MoveToParagraphStart()
MoveToPosition(DocumentPosition)
Moves the position to a specific position in the document.
Declaration
public void MoveToPosition(DocumentPosition newPosition)
Parameters
Document The new position. |
MoveToPrevious()
Moves the position to the previous possible position in the document.
Declaration
public bool MoveToPrevious()
Returns
System.
|
MoveToPreviousInline()
Moves the position to the previous InlineLayoutBox.
Declaration
public bool MoveToPreviousInline()
Returns
System.
|
MoveToPreviousInlineBox()
Moves the position to the previous Inline
Declaration
public bool MoveToPreviousInlineBox()
Returns
System.
|
MoveToPreviousPageEnd()
Moves the position to the last position on the previous page.
Declaration
public void MoveToPreviousPageEnd()
MoveToPreviousParagraphEnd()
Moves the position to the last position in the previous paragraph.
Declaration
public void MoveToPreviousParagraphEnd()
MoveToPreviousParagraphStart()
Moves the position to the first position in the previous paragraph.
Declaration
public void MoveToPreviousParagraphStart()
MoveToPreviousSpanBox()
Moves the position to the previous Span
Declaration
public bool MoveToPreviousSpanBox()
Returns
System.
|
MoveToPreviousWordStart()
Moves the position to the start of the previous word.
Declaration
public bool MoveToPreviousWordStart()
Returns
System.
|
MoveToStartOfDocumentElement(DocumentElement)
Moves the position to the start of a document element.
Declaration
public void MoveToStartOfDocumentElement(DocumentElement element)
Parameters
Document The document element. |
MoveToTableCellEnd()
Moves the position to the last position in the current table cell.
Declaration
public void MoveToTableCellEnd()
MoveToTableCellStart()
Moves the position to the first position in the current table cell.
Declaration
public void MoveToTableCellStart()
MoveUp()
Moves the position up.
Declaration
public bool MoveUp()
Returns
System.
|
MoveVertically(Single)
Moves the position vertically with specified offset.
Declaration
public void MoveVertically(float verticalOffset)
Parameters
System. The vertical offset. |
OnLocationChanged(Boolean)
Called after changing the location of the position.
Declaration
protected virtual void OnLocationChanged(bool changesCursorInitialLocation)
Parameters
System. if set to |
OnLocationChanging()
Called before changing the location of the position.
Declaration
protected virtual void OnLocationChanging()
OnPositionChanged()
Called when position is changed.
Declaration
protected virtual void OnPositionChanged()
OnPositionChanging()
Called when position is changing.
Declaration
protected virtual void OnPositionChanging()
RemoveAnchorFromNextFormattingSymbol()
Removes the anchor to the next formatting symbol.
Declaration
public void RemoveAnchorFromNextFormattingSymbol()
Reset()
Resets the position to the first position in the document.
Declaration
public void Reset()
RestorePositionFromBoxIndex(Nullable<Boolean>)
Restores the position from the box index.
Declaration
public void RestorePositionFromBoxIndex(Nullable<bool> raiseEvent = null)
Parameters
System.
|
SetPosition(PointF)
Moves the position to the nearest possible to a given point.
Declaration
public void SetPosition(PointF point)
Parameters
Point The point. |
ToString()
Returns a System.
Declaration
public override string ToString()
Returns
System. A System. |
Events
LocationChanged
Occurs when changing the coordinates of a position.
For the caret position, this can be also achieved by typing, using the arrows keys or by clicking somewhere in the document.
Declaration
public event EventHandler LocationChanged
Event Type
System.
|
LocationChanging
Occurs before changing the coordinates of a position.
For the caret position, this can be also achieved by typing, using the arrows keys or by clicking somewhere in the document.
Declaration
public event EventHandler LocationChanging
Event Type
System.
|
PositionChanged
Occurs when the position is moved.
For the caret position, this can be also achieved using the arrows keys or by clicking somewhere in the document.
Declaration
public event EventHandler PositionChanged
Event Type
System.
|
PositionChanging
Occurs before the position is moved.
For the caret position, this can be also achieved using the arrows keys or by clicking somewhere in the document.
Declaration
public event EventHandler PositionChanging
Event Type
System.
|
Operators
Equality(DocumentPosition, DocumentPosition)
Implements the operator ==.
Declaration
public static bool operator ==(DocumentPosition position1, DocumentPosition position2)
Parameters
Document The first position. |
Document The second position. |
Returns
System. The result of the operator. |
GreaterThan(DocumentPosition, DocumentPosition)
Implements the operator >.
Declaration
public static bool operator>(DocumentPosition position1, DocumentPosition position2)
Parameters
Document The first position. |
Document The second position. |
Returns
System. The result of the operator. |
GreaterThanOrEqual(DocumentPosition, DocumentPosition)
Implements the operator >=.
Declaration
public static bool operator >=(DocumentPosition position1, DocumentPosition position2)
Parameters
Document The first position. |
Document The second position. |
Returns
System. The result of the operator. |
Inequality(DocumentPosition, DocumentPosition)
Implements the operator !=.
Declaration
public static bool operator !=(DocumentPosition position1, DocumentPosition position2)
Parameters
Document The first position. |
Document The second position. |
Returns
System. The result of the operator. |
LessThan(DocumentPosition, DocumentPosition)
Implements the operator <.
Declaration
public static bool operator <(DocumentPosition position1, DocumentPosition position2)
Parameters
Document The first position. |
Document The second position. |
Returns
System. The result of the operator. |
LessThanOrEqual(DocumentPosition, DocumentPosition)
Implements the operator <=.
Declaration
public static bool operator <=(DocumentPosition position1, DocumentPosition position2)
Parameters
Document The first position. |
Document The second position. |
Returns
System. The result of the operator. |