CaretPosition
Represents a CaretPosition information.
Definition
Namespace:Telerik.WinForms.Controls.SyntaxEditor.UI
Assembly:Telerik.WinControls.SyntaxEditor.dll
Syntax:
public class CaretPosition : IComparable<CaretPosition>, IEquatable<CaretPosition>, IDisposable
Inheritance: objectCaretPosition
Implements:
Constructors
Initializes a new instance of the CaretPosition class.
public CaretPosition(CaretPosition position, PositionAnchoringType anchoringType)
The position.
anchoringTypePositionAnchoringTypeType of the anchoring.
Initializes a new instance of the CaretPosition class.
Initializes a new instance of the CaretPosition class.
public CaretPosition(TextDocument document, int lineNumber, int columnNumber, PositionAnchoringType anchoringType)
The document.
lineNumberintThe line number.
columnNumberintThe column number.
anchoringTypePositionAnchoringTypeType of the anchoring.
Initializes a new instance of the CaretPosition class.
public CaretPosition(TextDocument document, int lineNumber, int columnNumber)
The document.
lineNumberintThe line number.
columnNumberintThe column number.
Initializes a new instance of the CaretPosition class.
public CaretPosition(TextDocument document, PositionAnchoringType anchoringType)
The document.
anchoringTypePositionAnchoringTypeType of the anchoring.
Initializes a new instance of the CaretPosition class.
Properties
Gets the type of the anchoring.
public PositionAnchoringType AnchoringType { get; }
The type of the anchoring.
Gets the column number.
public int ColumnNumber { get; }
The column number.
Gets the display column number.
public int DisplayColumnNumber { get; }
The display column number.
Gets the display line number.
public int DisplayLineNumber { get; }
The display line number.
Gets the document.
public TextDocument Document { get; }
The document.
Gets a value indicating whether this instance is anchored.
public bool IsAnchored { get; }
Gets or sets the last tracked column. NOTE: Used for up/down.
public int LastTrackedColumn { get; set; }
The last tracked column.
Gets the line number.
public int LineNumber { get; }
The line number.
Methods
Compares the current object with another object of the same type.
public int CompareTo(CaretPosition other)
An object to compare with this object.
Returns: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 other parameter.Zero This object is equal to other. Greater than zero This object is greater than other.
Implements:
Converts from index.
public static CaretPosition ConvertFromIndex(TextDocument document, int index)
The document.
indexintThe index.
Returns:CaretPosition.
Converts to index.
public static int ConvertToIndex(CaretPosition position)
The position.
Returns:Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Implements:
Releases unmanaged and - optionally - managed resources.
protected virtual void Dispose(bool disposing)
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Indicates whether the current object is equal to another object of the same type.
public bool Equals(CaretPosition other)
An object to compare with this object.
Returns:true if the current object is equal to the other parameter; otherwise, false.
Implements:
Returns a hash code for this instance.
public override int GetHashCode()
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Overrides:
Determines whether [is at word start].
Moves the line down.
Moves the line up.
Moves to current word end.
Moves to current word start.
Moves to end of document.
public void MoveToEndOfDocument()
Moves to home.
public void MoveToHome()
Moves to line.
Moves to line end.
public void MoveToLineEnd()
Moves to line start.
public void MoveToLineStart()
Moves to next character.
Moves to next word.
Moves to position.
Moves to previous character.
Moves to previous word.
Moves to start of document.
public void MoveToStartOfDocument()
Called when [position changed].
protected virtual void OnPositionChanged()
Called when [position changing].
protected virtual void OnPositionChanging()
Events
PositionChanged event.
public event EventHandler PositionChanged
PositionChanging event.
public event EventHandler PositionChanging
Operators
Implements the != operator.
public static bool operator !=(CaretPosition left, CaretPosition right)
The left.
rightCaretPositionThe right.
Returns:The result of the operator.
Implements the < operator.
public static bool operator <(CaretPosition left, CaretPosition right)
The left.
rightCaretPositionThe right.
Returns:The result of the operator.
Implements the <= operator.
public static bool operator <=(CaretPosition left, CaretPosition right)
The left.
rightCaretPositionThe right.
Returns:The result of the operator.
Implements the == operator.
public static bool operator ==(CaretPosition left, CaretPosition right)
The left.
rightCaretPositionThe right.
Returns:The result of the operator.
Implements the > operator.
public static bool operator >(CaretPosition left, CaretPosition right)
The left.
rightCaretPositionThe right.
Returns:The result of the operator.
Implements the >= operator.
public static bool operator >=(CaretPosition left, CaretPosition right)
The left.
rightCaretPositionThe right.
Returns:The result of the operator.