SolutionServices.GetService<TWorkspaceService> 方法

定义

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

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

类型参数

TWorkspaceService

返回

TWorkspaceService

适用于