TypeProvider.GetService(Type) 方法

定义

获取提供指定服务 ObjectTypeGets the Object that provides the designated service Type.

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

Type 要提供的服务 ObjectThe service Type that the Object is to provide.

返回

提供指定服务 ObjectTypeThe Object that provides the designated service Type.

实现

注解

如果与此实例关联的包装 IServiceProvider 是一个空引用(在 Visual Basic 中为 Nothing),则返回一个空引用 (Nothing)。If the encapsulated IServiceProvider associated with this instance is a null reference (Nothing in Visual Basic) then a null reference (Nothing) is returned.

适用于