共用方式為


ServiceContainer.GetService(Type) 方法

定義

取得所要求的服務。

public:
 virtual System::Object ^ GetService(Type ^ serviceType);
public virtual object GetService (Type serviceType);
public virtual object? GetService (Type serviceType);
public object GetService (Type serviceType);
abstract member GetService : Type -> obj
override this.GetService : Type -> obj
Public Overridable Function GetService (serviceType As Type) As Object
Public Function GetService (serviceType As Type) As Object

參數

serviceType
Type

要擷取的服務類型。

傳回

如果可找到,則為服務的執行個體,如果無法找到,則為 null

實作

適用於

另請參閱