Share via


IPersistentSpan.TryGetStartLineIndex(Int32, Int32) Method

Definition

Get the starting point of the span as a line number and offset from the start of the line.

public:
 bool TryGetStartLineIndex([Runtime::InteropServices::Out] int % startLine, [Runtime::InteropServices::Out] int % startIndex);
bool TryGetStartLineIndex([Runtime::InteropServices::Out] int & startLine, [Runtime::InteropServices::Out] int & startIndex);
public bool TryGetStartLineIndex (out int startLine, out int startIndex);
abstract member TryGetStartLineIndex : int * int -> bool
Public Function TryGetStartLineIndex (ByRef startLine As Integer, ByRef startIndex As Integer) As Boolean

Parameters

startLine
Int32

Line number of the start point.

startIndex
Int32

Character offset from the start of the line containing the start point.

Returns

true if the the out parameters are valid; false otherwise (in which case TryGetSpan will work).

Remarks

This method can be used on any span if the underlying document is open.

If the underlying document is closed, then this method can be used if either the document was created on the closed document using the line/index method of the factory or the document had ever been opened after the span was created.

In general, you should try this method (and TryGetEndLineIndex(Int32, Int32)) before using TryGetSpan(Span).

Applies to