ServiceContainer.GetService(Type) 方法

定義

取得所要求的服務。Gets the requested service.

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

參數

serviceType
Type

要擷取的服務型別。The type of service to retrieve.

傳回

如果可找到,則為服務的執行個體,如果無法找到,則為 nullAn instance of the service if it could be found, or null if it could not be found.

實作

適用於

另請參閱