Dela 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 (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)

Syntax

'Declaration
Public Function GetService ( _
    serviceType As Type _
) As Object
public Object GetService(
    Type serviceType
)
public:
Object^ GetService(
    Type^ serviceType
)
member GetService : 
        serviceType:Type -> Object
public function GetService(
    serviceType : Type
) : Object

Parameters

  • serviceType
    Type: Type

    [in] The GUID of the service to get.

Return Value

Type: 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

Microsoft.VisualStudio.Package Namespace