Compartilhar via


Source.GetLineIndexOfPosition Method

Gets the line and column for the specified position.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)

Syntax

'Declaration
Public Sub GetLineIndexOfPosition ( _
    position As Integer, _
    <OutAttribute> ByRef line As Integer, _
    <OutAttribute> ByRef col As Integer _
)
public void GetLineIndexOfPosition(
    int position,
    out int line,
    out int col
)
public:
void GetLineIndexOfPosition(
    int position, 
    [OutAttribute] int% line, 
    [OutAttribute] int% col
)
member GetLineIndexOfPosition : 
        position:int * 
        line:int byref * 
        col:int byref -> unit
public function GetLineIndexOfPosition(
    position : int, 
    line : int, 
    col : int
)

Parameters

  • position
    Type: Int32

    The position or character offset into the source file.

  • line
    Type: Int32%

    [out] Returns the line number corresponding to the position.

  • col
    Type: Int32%

    [out] Returns the column number (offset on the line) corresponding to the position.

Remarks

This method forwards the call to the GetLineIndexOfPosition method on the IVsTextLines object passed to the Source class constructor. An exception is thrown if an error occurs.

.NET Framework Security

See Also

Reference

Source Class

Microsoft.VisualStudio.Package Namespace