LanguageService.GetLanguageID Method
Returns the language GUID of the language service.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Syntax
'Déclaration
Public Overridable Function GetLanguageID ( _
buffer As IVsTextBuffer, _
line As Integer, _
col As Integer, _
<OutAttribute> ByRef langId As Guid _
) As Integer
'Utilisation
Dim instance As LanguageService
Dim buffer As IVsTextBuffer
Dim line As Integer
Dim col As Integer
Dim langId As Guid
Dim returnValue As Integer
returnValue = instance.GetLanguageID(buffer, _
line, col, langId)
public virtual int GetLanguageID(
IVsTextBuffer buffer,
int line,
int col,
out Guid langId
)
public:
virtual int GetLanguageID(
IVsTextBuffer^ buffer,
int line,
int col,
[OutAttribute] Guid% langId
)
abstract GetLanguageID :
buffer:IVsTextBuffer *
line:int *
col:int *
langId:Guid byref -> int
override GetLanguageID :
buffer:IVsTextBuffer *
line:int *
col:int *
langId:Guid byref -> int
public function GetLanguageID(
buffer : IVsTextBuffer,
line : int,
col : int,
langId : Guid
) : int
Parameters
- buffer
Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextBuffer
[in] The IVsTextBuffer containing the source for which to get the language id.
- line
Type: System.Int32
[in] The line index into the buffer to the source for which to get the language.
- col
Type: System.Int32
[in] The character position in the line.
- langId
Type: System.Guid%
[out] Returns the GUID of the language for the associated source.
Return Value
Type: System.Int32
If successful, returns S_OK; otherwise, returns an error code.
Implements
IVsLanguageDebugInfo.GetLanguageID(IVsTextBuffer, Int32, Int32, Guid%)
Remarks
The supplied buffer object holds the entire source file. Some source files support mixed languages, for example JScript and VBScript embedded in an HTML page. This method is called to get the language ID for a particular debugger. If you support multiple languages in a source file, you must derive a class from the LanguageService class and override this method in your class.
The base method always calls LanguageService.GetLanguageServiceGuid which returns the GUID of the language service. This assumes the source file contains only a single language.
.NET Framework Security
- 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.