IServiceProvider IServiceProvider IServiceProvider IServiceProvider Interface

定义

定义一种检索服务对象的机制,服务对象是为其他对象提供自定义支持的对象。Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.

public interface class IServiceProvider
[System.Runtime.InteropServices.ComVisible(false)]
public interface IServiceProvider
type IServiceProvider = interface
Public Interface IServiceProvider
派生
属性

注解

此接口由向其他对象提供服务的类或值类型实现。This interface is implemented by a class or value type that provides a service to other objects.

此接口的方法获取提供服务的对象。 GetServiceThe GetService method of this interface obtains the object that provides the service.

System.Web.HttpContext System.ComponentModel.LicenseContext System.ComponentModel.MarshalByValueComponent接口由多种类型 (包括、、和System.ComponentModel.Design.ServiceContainer) 实现。 IServiceProviderThe IServiceProvider interface is implemented by a number of types, including System.Web.HttpContext, System.ComponentModel.LicenseContext, System.ComponentModel.MarshalByValueComponent, and System.ComponentModel.Design.ServiceContainer.

方法

GetService(Type) GetService(Type) GetService(Type) GetService(Type)

获取指定类型的服务对象。Gets the service object of the specified type.

适用于

另请参阅