Component.GetService(Type) 方法

定義

傳回表示 Component 或其 Container 所提供之服務的物件。Returns an object that represents a service provided by the Component or by its Container.

protected:
 virtual System::Object ^ GetService(Type ^ service);
protected virtual object? GetService (Type service);
protected virtual object GetService (Type service);
abstract member GetService : Type -> obj
override this.GetService : Type -> obj
Protected Overridable Function GetService (service As Type) As Object

參數

service
Type

Component 所提供的服務。A service provided by the Component.

傳回

Object

Object,表示 Component 提供的服務,如果 Component 沒有提供指定的服務,則為 nullAn Object that represents a service provided by the Component, or null if the Component does not provide the specified service.

備註

衍生類別可以覆寫這個方法。This method can be overridden by a derived class.

適用於

另請參閱