Mono Class Library: System Namespace

System.IServiceProvider

This interface is used to query for instances of objects based on a Type. [Edit]

See Also: IServiceProvider Members

public interface IServiceProvider

Remarks

This interface provides a mechanism to fetch instances to objects of a given Type from classes that implement this interface. For example the System.Web.HttpContext class implements this and allows fething a few fields that are not exposed by its properties.

A typical implementation will look like this:

C# Example
 		object IServiceProvider.GetService (Type service)
		{
			if (service == typeof (Something))
				return something;
			if (service == typeof (DateTime))
				return my_date_time;
		}
  
[Edit]

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0