Component.GetService(Type) 方法

定义

返回一个对象,该对象表示由 Component 或它的 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 提供的服务。

返回

表示由 Object 提供的服务的 Component,如果 Component 不提供指定的服务,则为 null

注解

派生类可以重写此方法。

适用于

另请参阅