LanguageService.GetService Method
Returns a service object that can be cast to a specific interface.
Namespace: Microsoft.VisualStudio.Package
Assembly: Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Syntax
'宣言
Public Function GetService ( _
serviceType As Type _
) As Object
'使用
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
)
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.
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.