Interface IMefServiceLocator
This interface is one of many which the Dapplo.Addon CompositionBootstrapper (ApplicationBootstrapper) implements. The Bootstrapper will automatically export itself as IMefServiceLocator, so framework code can use imports to get basic servicelocator support. A IMefServiceLocator should only be used for cases where a simple import can't work.
Namespace:Dapplo.Addons
Assembly:Dapplo.Addons.dll
Syntax
public interface IMefServiceLocator
Methods
| Improve this Doc View SourceGetExport(Type, String)
Simple "service-locater"
Declaration
object GetExport(Type type, string contractName = "")
Parameters
Type | Name | Description |
---|---|---|
Type | type | Type to locate |
System.String | contractName | Key/Name of the contract, null or an empty string |
Returns
Type | Description |
---|---|
System.Object | object for type |
GetExport<T>(String)
Simple "service-locater"
Declaration
Lazy<T> GetExport<T>(string contractName = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | contractName | Key/Name of the contract, null or an empty string |
Returns
Type | Description |
---|---|
Lazy<T> | Lazy T |
Type Parameters
Name | Description |
---|---|
T | Type to locate |
GetExport<T, TMetaData>(String)
Simple "service-locater" with meta-data
Declaration
Lazy<T, TMetaData> GetExport<T, TMetaData>(string contractName = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | contractName | Key/Name of the contract, null or an empty string |
Returns
Type | Description |
---|---|
Lazy<T, TMetaData> | Lazy T,TMetaData |
Type Parameters
Name | Description |
---|---|
T | Type to locate |
TMetaData | interface-type for the meta-data |
GetExports(Type, String)
Simple "service-locater" to get multiple exports
Declaration
IEnumerable<Lazy<object>> GetExports(Type type, string contractName = "")
Parameters
Type | Name | Description |
---|---|---|
Type | type | Type to locate |
System.String | contractName | Key/Name of the contract, null or an empty string |
Returns
Type | Description |
---|---|
IEnumerable<Lazy<System.Object>> | IEnumerable of Lazy object |
GetExports<T>(String)
Simple "service-locater" to get multiple exports
Declaration
IEnumerable<Lazy<T>> GetExports<T>(string contractName = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | contractName | Key/Name of the contract, null or an empty string |
Returns
Type | Description |
---|---|
IEnumerable<Lazy<T>> | IEnumerable of Lazy T |
Type Parameters
Name | Description |
---|---|
T | Type to locate |
GetExports<T, TMetaData>(String)
Simple "service-locater" to get multiple exports with meta-data
Declaration
IEnumerable<Lazy<T, TMetaData>> GetExports<T, TMetaData>(string contractName = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | contractName | Key/Name of the contract, null or an empty string |
Returns
Type | Description |
---|---|
IEnumerable<Lazy<T, TMetaData>> | IEnumerable of Lazy T,TMetaData |
Type Parameters
Name | Description |
---|---|
T | Type to locate |
TMetaData | interface-type for the meta-data |