Compartir a través de


ServiceProvider.GetService Method (Guid)

Retrieves a service with a specified service GUID.

Namespace:  Microsoft.VisualStudio.Data
Assembly:  Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)

Syntax

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

Parameters

Return Value

Type: System.Object
Returns the service with the specified service GUID, or returns nulla 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.

.NET Framework Security

See Also

Reference

ServiceProvider Class

GetService Overload

Microsoft.VisualStudio.Data Namespace