ITextPositionFinder Interface
Provides the base requirements for a helper class that finds TextPosition objects based on the current state of an IEditorView.
public interface ITextPositionFinder
Methods
GetPositionForCharacterDelta(TextPosition, int, bool, bool)
Returns the TextPosition that is relative to the specified TextPosition by a number of visible characters.
TextPosition GetPositionForCharacterDelta(TextPosition position, int characterDelta, bool wrapAtLineTerminators, bool forceVirtualSpace)
Parameter | Type | Description |
---|---|---|
position | TextPosition | The start TextPosition from which to search. |
characterDelta | int | The number of visible characters (can be negative) relative to the start TextPosition that should be traversed to find the result. |
wrapAtLineTerminators | bool | Whether to wrap to the next/previous view line when a line terminator is encountered. |
forceVirtualSpace | bool | Whether to force virtual space to be used (for block selections). |
Returns
- TextPosition:
The TextPosition that would found based on the criteria.
GetPositionForLineDelta(TextPosition, int, int?, bool)
Returns the TextPosition that is relative to the specified TextPosition by a number of visible view lines.
TextPosition GetPositionForLineDelta(TextPosition position, int lineDelta, int? preferredHorizontalLocation, bool forceVirtualSpace)
Parameter | Type | Description |
---|---|---|
position | TextPosition | The start TextPosition from which to search. |
lineDelta | int | The number of visible view lines (can be negative) relative to the start TextPosition that should be traversed to find the result. |
preferredHorizontalLocation | int? | The preferred horizontal location, if known. |
forceVirtualSpace | bool | Whether to force virtual space to be used (for block selections). |
Returns
- TextPosition:
The TextPosition that would found based on the criteria.
GetPositionForLineEnd(TextPosition)
Returns the TextPosition for the end of the view line upon which the specified TextPosition falls.
TextPosition GetPositionForLineEnd(TextPosition position)
Parameter | Type | Description |
---|---|---|
position | TextPosition | The start TextPosition from which to search. |
Returns
- TextPosition:
The TextPosition that would found based on the criteria.
GetPositionForLineStart(TextPosition)
Returns the TextPosition for the start of the view line upon which the specified TextPosition falls.
TextPosition GetPositionForLineStart(TextPosition position)
Parameter | Type | Description |
---|---|---|
position | TextPosition | The start TextPosition from which to search. |
Returns
- TextPosition:
The TextPosition that would found based on the criteria.