Retrieves a service with a specified service GUID.
Namespace: Microsoft.VisualStudio.Data.Framework
Assembly: Microsoft.VisualStudio.Data.Framework (in Microsoft.VisualStudio.Data.Framework.dll)
Syntax
'宣言
Public Overridable Function GetService ( _
serviceGuid As Guid _
) As Object
'使用
Dim instance As ServiceProvider
Dim serviceGuid As Guid
Dim returnValue As Object
returnValue = instance.GetService(serviceGuid)
public virtual Object GetService(
Guid serviceGuid
)
public:
virtual Object^ GetService(
Guid serviceGuid
)
public function GetService(
serviceGuid : Guid
) : Object
Parameters
serviceGuid
Type: System.GuidThe GUID of a service.
Return Value
Type: System.Object
The service with the specified service GUID, or a null reference (Nothing in Visual Basic) if no service is found.
Remarks
This method uses the information specified by the Services property to map the GUID into a Type value, and then tries to get the service through a call to GetService. If this method is not able to obtain the service, and the parent implements the unmanaged IServiceProvider to which the specified service GUID can be passed, it queries the parent service.
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.