다음을 통해 공유


Source.GetPositionOfLineIndex Method

Gets the position corresponding to the given line and character offset location.

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 Function GetPositionOfLineIndex ( _
    line As Integer, _
    col As Integer _
) As Integer
public int GetPositionOfLineIndex(
    int line,
    int col
)
public:
int GetPositionOfLineIndex(
    int line, 
    int col
)
member GetPositionOfLineIndex : 
        line:int * 
        col:int -> int
public function GetPositionOfLineIndex(
    line : int, 
    col : int
) : int

Parameters

  • line
    Type: Int32

    The line number of the location.

  • col
    Type: Int32

    The offset on the line of the location.

Return Value

Type: Int32
The position or character offset from the start of the source file.

Remarks

This method forwards the call to the GetPositionOfLineIndex 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