LanguageService.GetNameOfLocation 方法

返回包含给定位置中的元素的名称。

命名空间:  Microsoft.VisualStudio.Package
程序集:   Microsoft.VisualStudio.Package.LanguageService.9.0(在 Microsoft.VisualStudio.Package.LanguageService.9.0.dll 中)
  Microsoft.VisualStudio.Package.LanguageService.10.0(在 Microsoft.VisualStudio.Package.LanguageService.10.0.dll 中)
  Microsoft.VisualStudio.Package.LanguageService.11.0(在 Microsoft.VisualStudio.Package.LanguageService.11.0.dll 中)
  Microsoft.VisualStudio.Package.LanguageService(在 Microsoft.VisualStudio.Package.LanguageService.dll 中)

语法

声明
Public Overridable Function GetNameOfLocation ( _
    buffer As IVsTextBuffer, _
    line As Integer, _
    col As Integer, _
    <OutAttribute> ByRef name As String, _
    <OutAttribute> ByRef lineOffset As Integer _
) As Integer
public virtual int GetNameOfLocation(
    IVsTextBuffer buffer,
    int line,
    int col,
    out string name,
    out int lineOffset
)

参数

  • line
    类型:System.Int32
    [in] 缓冲区中的所需行。
  • col
    类型:System.Int32
    [in] 在行所需的偏移量缓冲区。
  • lineOffset
    类型:System.Int32%
    [out] 偏移量开始中的元素对特定行。

返回值

类型:System.Int32
如果成功,则返回; S_OK否则,返回 S_FALSE ,如果此位置不在命名实体或返回错误代码。

实现

IVsLanguageDebugInfo.GetNameOfLocation(IVsTextBuffer, Int32, Int32, String%, Int32%)

备注

一个包含的元素通常是方法、类或命名空间。

该基方法返回该名称的 null 值和 0 行偏移量。

.NET Framework 安全性

请参见

参考

LanguageService 类

Microsoft.VisualStudio.Package 命名空间