HostWorkspaceServices.GetService<TWorkspaceService> 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取由服务类型标识的主机提供的特定于工作区的服务。 如果主机未提供服务,此方法返回 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