LanguageService.GetService Method
Returns a service object that can be cast to a specific interface.
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
'Declaración
Public Function GetService ( _
serviceType As Type _
) As Object
'Uso
Dim instance As LanguageService
Dim serviceType As Type
Dim returnValue As Object
returnValue = instance.GetService(serviceType)
public Object GetService(
Type serviceType
)
public:
Object^ GetService(
Type^ serviceType
)
member GetService :
serviceType:Type -> Object
public function GetService(
serviceType : Type
) : Object
Parameters
- serviceType
Type: System.Type
[in] The GUID of the service to get.
Return Value
Type: System.Object
If successful, returns an object that can be cast to a desired interface; otherwise, returns a null value (the service does not exist or is not available).
Remarks
A service proffers at least one interface and other, related interfaces can be obtained from either the service or another interface.
.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.