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.

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

IServiceProvider接口的类型,包括许多由实现System.Web.HttpContextSystem.ComponentModel.LicenseContextSystem.ComponentModel.MarshalByValueComponent,和System.ComponentModel.Design.ServiceContainerThe 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.

适用于

另请参阅