New to Telerik UI for WinForms? Start a free 30-day trial

Tracks a character position within a span layout box and maps that offset to document coordinates.

Definition

Namespace:Telerik.WinForms.Documents

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class SpanBoxPositionHandler : InlineBoxPositionHandler

Inheritance: objectPositionHandlerInlineBoxPositionHandlerSpanBoxPositionHandler

Inherited Members InlineBoxPositionHandler.GetParentHandler()InlineBoxPositionHandler.CurrentInlinePositionHandler.Box

Constructors

Creates a handler for the same span and character position as another handler.

C#
public SpanBoxPositionHandler(SpanBoxPositionHandler toCopy)
Parameters:toCopySpanBoxPositionHandler

The handler whose span and current character position are copied.

Initializes a character-position handler for the specified span layout box.

C#
public SpanBoxPositionHandler(SpanLayoutBox spanBox)
Parameters:spanBoxSpanLayoutBox

The span layout box whose text positions are navigated.

Properties

Gets whether another character position remains after the current index in this span.

C#
public override bool CanMoveToNext { get; }

Overrides: InlineBoxPositionHandler.CanMoveToNext

Gets whether a character position precedes the current index in this span.

C#
public override bool CanMoveToPrevious { get; }

Overrides: InlineBoxPositionHandler.CanMoveToPrevious

Gets or sets the current character index within the span's text.

C#
public int CurrentPositionInSpanBox { get; set; }
Property Value:

The zero-based character index.

For non-empty text, setting a value outside the text bounds throws on WinForms targets. Assignments for empty text differ across target frameworks.

Gets the span layout box containing the current position.

C#
public SpanLayoutBox CurrentSpanBox { get; }

Gets the caret coordinates for the current character index, accounting for text measurement and right-to-left layout.

C#
public override PointF Location { get; }

Overrides: InlineBoxPositionHandler.Location

Methods

Creates a copy of this handler's current navigation state.

C#
public override PositionHandler Clone()
Returns:

PositionHandler

A position handler representing the copied state.

Overrides: InlineBoxPositionHandler.Clone()

Determines whether another handler represents the same span box and character index.

C#
public override bool Equals(object obj)
Parameters:objobject

The object to compare with this handler.

Returns:

bool

true when the span box and index match; otherwise, false.

Overrides: PositionHandler.Equals(object)

Returns a hash code that includes both the span box and character index.

C#
public override int GetHashCode()
Returns:

int

The combined hash code.

Overrides: PositionHandler.GetHashCode()

Not supported because this handler represents a single position.

C#
public override void MoveToFirst()
Exceptions: InvalidOperationException

The operation is not supported by this handler.

Overrides: InlineBoxPositionHandler.MoveToFirst()

Leaves the handler at its only position.

C#
public override void MoveToLast()

Overrides: InlineBoxPositionHandler.MoveToLast()

Moves the current character index to the text split nearest the specified point within this span.

C#
public bool MoveToLocation(PointF location)
Parameters:locationPointF

The point in document coordinates to map to a text position.

Returns:

bool

true when the point maps within this span; otherwise, false so navigation can continue in another layout box.

Not supported because this handler represents a single position.

C#
public override void MoveToNext()
Exceptions: InvalidOperationException

The operation is not supported by this handler.

Overrides: InlineBoxPositionHandler.MoveToNext()

Not supported because this handler represents a single position.

C#
public override void MoveToPrevious()
Exceptions: InvalidOperationException

The operation is not supported by this handler.

Overrides: InlineBoxPositionHandler.MoveToPrevious()

Returns a string containing the span box and current character index.

C#
public override string ToString()
Returns:

string

The span box and index in diagnostic form.

Overrides: InlineBoxPositionHandler.ToString()