Returns the name of the enclosing element that contains the given position.
Namespace: Microsoft.VisualStudio.Package
Assembly: Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Syntax
'宣言
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
'使用
Dim instance As LanguageService
Dim buffer As IVsTextBuffer
Dim line As Integer
Dim col As Integer
Dim name As String
Dim lineOffset As Integer
Dim returnValue As Integer
returnValue = instance.GetNameOfLocation(buffer, _
line, col, name, lineOffset)
public virtual int GetNameOfLocation(
IVsTextBuffer buffer,
int line,
int col,
out string name,
out int lineOffset
)
public:
virtual int GetNameOfLocation(
IVsTextBuffer^ buffer,
int line,
int col,
[OutAttribute] String^% name,
[OutAttribute] int% lineOffset
)
public function GetNameOfLocation(
buffer : IVsTextBuffer,
line : int,
col : int,
name : String,
lineOffset : int
) : int
Parameters
buffer
Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextBuffer[in] The IVsTextBuffer holding the source file.
line
Type: System.Int32[in] The desired line in the buffer.
col
Type: System.Int32[in] The desired offset on the line in the buffer.
name
Type: System.String%[out] The name of the enclosing element.
lineOffset
Type: System.Int32%[out] The offset from the start of the enclosing element to the given line.
Return Value
Type: System.Int32
If successful, returns S_OK; otherwise, returns S_FALSE if the location is not within a named entity or returns an error code.
Implements
IVsLanguageDebugInfo.GetNameOfLocation(IVsTextBuffer, Int32, Int32, String%, Int32%)
Remarks
An enclosing element is typically a method, class, or namespace.
The base method returns a null value for the name and 0 for the line offset.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.