다음을 통해 공유


CaretPosition Struct

Definition

Represents the position of a caret in an ITextView.

public value class CaretPosition
struct CaretPosition
public struct CaretPosition
type CaretPosition = struct
Public Structure CaretPosition
Inheritance
CaretPosition

Examples

For an example of finding the caret position, see Walkthrough: Displaying Matching Braces.

Remarks

To get the caret's current position, you can listen to the PositionChanged event. (You can get the caret from the ITextView.)The ITextCaret class includes methods that allow you to move the caret to a different position.

Constructors

CaretPosition(VirtualSnapshotPoint, IMappingPoint, PositionAffinity)

Initializes a new instance of a CaretPosition.

Properties

Affinity

Gets the affinity of the caret. Predecessor indicates that the caret is bound to the preceding edge of the gap. Successor indicates that the caret is bound to the following edge of the gap.

BufferPosition

Gets the position of the caret, corresponding to a gap between two characters in the ITextBuffer of the view.

Point

Gets the IMappingPoint. This marks the position of the caret in the buffer.

VirtualBufferPosition

Gets the virtual buffer position as a VirtualSnapshotPoint.

VirtualSpaces

Gets the number of spaces past the physical end of the line of the caret position.

Methods

Equals(Object)

Determines whether two CaretPosition objects are the same

GetHashCode()

Gets the hash code for the CaretPosition.

ToString()

Provides a string representation of the caret position.

Operators

Equality(CaretPosition, CaretPosition)

Determines whether two CaretPosition objects are the same.

Inequality(CaretPosition, CaretPosition)

Determines whether two CaretPosition objects are different.

Applies to