[]
        
(Showing Draft Content)

C1.WPF.RichTextBox.Documents.C1TextPointer.GetOffsetToPosition

GetOffsetToPosition Method

GetOffsetToPosition(C1TextPointer, Predicate<Tag>)

Returns the count of symbols between this C1TextPointer and a second specified C1TextPointer.

Declaration
public int GetOffsetToPosition(C1TextPointer position, Predicate<Tag> tagFilter)
Parameters
Type Name Description
C1TextPointer position

A C1TextPointer that specifies a position to find the distance (in symbols) to.

Predicate<Tag> tagFilter

A predicate that can be called to check if a Tag should count as offset. The predicate should return true iff the tag doesn't count. Can be null, which means no filter.

Returns
Type Description
int

The relative number of symbols between the current C1TextPointer and position. A negative value indicates that the current C1TextPointer follows the position specified by position, 0 indicates that the positions are equal, and a positive value indicates that the current C1TextPointer precedes the position specified by position.

GetOffsetToPosition(C1TextPointer)

Equivalent to GetOffsetToPosition(C1TextPointer, Predicate<Tag>) with null as tagFilter.

Declaration
public int GetOffsetToPosition(C1TextPointer position)
Parameters
Type Name Description
C1TextPointer position
Returns
Type Description
int