共用方式為


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

適用於