C# Class Elmah.ServiceCenter

Central point for locating arbitrary services.
Mostra file Open project: elmah/Elmah Class Usage Examples

Public Properties

Property Type Description
Default ServiceProviderQueryHandler

Public Methods

Method Description
FindService ( object context, Type serviceType ) : object

Attempts to locate a service of a given type based on a given context. If the service is not available, a null reference is returned.

GetService ( object context, Type serviceType ) : object

Gets a service of a given type based on a given context. If the service is not available, an exception is thrown.

GetServiceProvider ( object context ) : IServiceProvider

Gets an IServiceProvider object based on a supplied context and which can be used to request further services.

Private Methods

Method Description
CreateServiceContainer ( object context ) : IServiceProvider
ServiceCenter ( ) : System

Method Details

FindService() public static method

Attempts to locate a service of a given type based on a given context. If the service is not available, a null reference is returned.
public static FindService ( object context, Type serviceType ) : object
context object
serviceType System.Type
return object

GetService() public static method

Gets a service of a given type based on a given context. If the service is not available, an exception is thrown.
public static GetService ( object context, Type serviceType ) : object
context object
serviceType System.Type
return object

GetServiceProvider() public static method

Gets an IServiceProvider object based on a supplied context and which can be used to request further services.
public static GetServiceProvider ( object context ) : IServiceProvider
context object
return IServiceProvider

Property Details

Default public_oe static_oe property

The default and factory-supplied implementation of ServiceProviderQueryHandler.
public static ServiceProviderQueryHandler Default
return ServiceProviderQueryHandler