Retrieves a service with a specified service GUID.
Namespace: Microsoft.VisualStudio.Data
Assembly: Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)
Syntax
'宣言
Public Function GetService ( _
serviceGuid As Guid _
) As Object
'使用
Dim instance As ServiceProvider
Dim serviceGuid As Guid
Dim returnValue As Object
returnValue = instance.GetService(serviceGuid)
public Object GetService(
Guid serviceGuid
)
public:
Object^ GetService(
Guid serviceGuid
)
public function GetService(
serviceGuid : Guid
) : Object
Parameters
serviceGuid
Type: System.GuidThe GUID of a service.
Return Value
Type: System.Object
Returns the service with the specified service GUID, or returns a null reference (Nothing in Visual Basic) if no service was found.
Remarks
The behavior of this method differs depending on the purpose of the IServiceProvider instance. When this object is providing a service provider, it uses the information specified by the ServiceTypes property to map the GUID into a Type value, then delegates to the GetServiceImpl method. On the other hand, if it is unable to map the GUID, it delegates to the GetServiceImpl method.
When this object is wrapping an unmanaged service provider, it marshals the request to the underlying COM interface and returns the result.
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.