次の方法で共有


IVsDataHostService.GetService Method

Definition

Overloads

GetService<T>()

Gets a global Visual Studio service of the specified type.

GetService<T>(Guid)

Gets a global Visual Studio service that is registered with the specified class ID that implements the specified interface.

GetService<TService,TInterface>()

Gets a global Visual Studio service of the specified type that implements the specified interface.

GetService<T>()

Gets a global Visual Studio service of the specified type.

public:
generic <typename T>
 T GetService();
public T GetService<T> ();
abstract member GetService : unit -> 'T
Public Function GetService(Of T) () As T

Type Parameters

T

The service.

Returns

T

The service instance.

Exceptions

Microsoft.VisualStudio.Data.ServiceNotFoundException

The service was not found.

Applies to

GetService<T>(Guid)

Gets a global Visual Studio service that is registered with the specified class ID that implements the specified interface.

public:
generic <typename T>
 T GetService(Guid serviceGuid);
public T GetService<T> (Guid serviceGuid);
abstract member GetService : Guid -> 'T
Public Function GetService(Of T) (serviceGuid As Guid) As T

Type Parameters

T

The interface.

Parameters

serviceGuid
Guid

The class ID of the service to retrieve.

Returns

T

The service instance.

Exceptions

Microsoft.VisualStudio.Data.ServiceNotFoundException

The service was not found.

Applies to

GetService<TService,TInterface>()

Gets a global Visual Studio service of the specified type that implements the specified interface.

public:
generic <typename TService, typename TInterface>
 TInterface GetService();
public TInterface GetService<TService,TInterface> ();
abstract member GetService : unit -> 'Interface
Public Function GetService(Of TService, TInterface) () As TInterface

Type Parameters

TService

The service.

TInterface

The interface.

Returns

TInterface

The service instance.

Exceptions

Microsoft.VisualStudio.Data.ServiceNotFoundException

The service was not found.

Applies to