Share via


ITextSnapshot.GetLineNumberFromPosition Method

Gets the number of the line that contains the character at the specified position.

Namespace:  Microsoft.VisualStudio.Text
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)

Syntax

'Declaration
Function GetLineNumberFromPosition ( _
    position As Integer _
) As Integer
int GetLineNumberFromPosition(
    int position
)
int GetLineNumberFromPosition(
    int position
)
abstract GetLineNumberFromPosition : 
        position:int -> int
function GetLineNumberFromPosition(
    position : int
) : int

Parameters

  • position
    Type: System.Int32

    The position from which to get the line number.

Return Value

Type: System.Int32
The line number of the line in which position lies.

Exceptions

Exception Condition
ArgumentOutOfRangeException

position is less than zero or greater than the length of the line.

.NET Framework Security

See Also

Reference

ITextSnapshot Interface

Microsoft.VisualStudio.Text Namespace