HostWorkspaceServices.GetService<TWorkspaceService> 方法

定义

获取由服务类型标识的主机提供的特定于工作区的服务。 如果主机未提供服务,此方法返回 null。

public:
generic <typename TWorkspaceService>
 where TWorkspaceService : Microsoft::CodeAnalysis::Host::IWorkspaceService abstract TWorkspaceService GetService();
public abstract TWorkspaceService GetService<TWorkspaceService> () where TWorkspaceService : Microsoft.CodeAnalysis.Host.IWorkspaceService;
public abstract TWorkspaceService? GetService<TWorkspaceService> () where TWorkspaceService : Microsoft.CodeAnalysis.Host.IWorkspaceService;
abstract member GetService : unit -> 'WorkspaceService (requires 'WorkspaceService :> Microsoft.CodeAnalysis.Host.IWorkspaceService)
Public MustOverride Function GetService(Of TWorkspaceService As IWorkspaceService) () As TWorkspaceService

类型参数

TWorkspaceService

返回

TWorkspaceService

适用于