Partager via


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

'Déclaration
Public Function GetService ( _
    serviceType As Type _
) As Object
'Utilisation
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

See Also

Reference

LanguageService Class

LanguageService Members

Microsoft.VisualStudio.Package Namespace