Component.GetService(Type) Component.GetService(Type) Component.GetService(Type) Component.GetService(Type) Method

定义

返回一个对象,该对象表示由 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);
abstract member GetService : Type -> obj
override this.GetService : Type -> obj
Protected Overridable Function GetService (service As Type) As Object

参数

service
Type Type Type Type

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

返回

表示由 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.

适用于

另请参阅