Class MefServiceLocatorAdapter
Provides service location utilizing the Managed Extensibility Framework container.
ServiceLocatorImplBase.GetInstance<TService>()
ServiceLocatorImplBase.GetAllInstances<TService>()
Namespace: Sartorius.SAF.Presentation.MefExtensions
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public class MefServiceLocatorAdapter : ServiceLocatorImplBase, IServiceLocator, IServiceProvider
Constructors
View SourceMefServiceLocatorAdapter(CompositionContainer)
Initializes a new instance of the MefServiceLocatorAdapter class.
Declaration
public MefServiceLocatorAdapter(CompositionContainer compositionContainer)
Parameters
| Type | Name | Description |
|---|---|---|
| CompositionContainer | compositionContainer | The MEF composition container. |
Methods
View SourceDoGetAllInstances(Type)
Resolves the instance of the requested service.
Declaration
protected override IEnumerable<object> DoGetAllInstances(Type serviceType)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | serviceType | Type of instance requested. |
Returns
| Type | Description |
|---|---|
| IEnumerable<object> | The requested service instance. |
Overrides
View SourceDoGetInstance(Type, string)
Resolves all the instances of the requested service.
Declaration
protected override object DoGetInstance(Type serviceType, string key)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | serviceType | Type of service requested. |
| string | key | Name of registered service you want. May be null. |
Returns
| Type | Description |
|---|---|
| object | Sequence of service instance objects. |
Overrides
Implements
CommonServiceLocator.IServiceLocator