Class MefPartConventionsBuilder
Conventions builder for a specific part.
Inheritance
Implements
Inherited Members
Namespace: Kephas.Composition.Mef.Conventions
Assembly: Kephas.Composition.Mef.dll
Syntax
public class MefPartConventionsBuilder : IPartConventionsBuilder
Methods
| Improve this Doc View SourceAsServiceType(Type)
Indicates the declared service type. Typically this is the same as the contract type, but this may get overwritten, for example when declaring generic type services for collecting metadata.
Declaration
public IPartConventionsBuilder AsServiceType(Type serviceType)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | serviceType | Type of the service. |
Returns
| Type | Description |
|---|---|
| IPartConventionsBuilder | A part builder allowing further configuration of the part. |
Export(Action<IExportConventionsBuilder>)
Exports the part using the specified conventions builder.
Declaration
public IPartConventionsBuilder Export(Action<IExportConventionsBuilder> conventionsBuilder = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action<IExportConventionsBuilder> | conventionsBuilder | The conventions builder. |
Returns
| Type | Description |
|---|---|
| IPartConventionsBuilder | A part builder allowing further configuration of the part. |
ExportInterface(Type, Action<Type, IExportConventionsBuilder>)
Select the interface on the part type that will be exported.
Declaration
public IPartConventionsBuilder ExportInterface(Type exportInterface, Action<Type, IExportConventionsBuilder> exportConfiguration = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | exportInterface | The interface to export. |
| System.Action<System.Type, IExportConventionsBuilder> | exportConfiguration | The export configuration. |
Returns
| Type | Description |
|---|---|
| IPartConventionsBuilder | A part builder allowing further configuration of the part. |
Scoped()
Mark the part as being shared within the scope.
Declaration
public IPartConventionsBuilder Scoped()
Returns
| Type | Description |
|---|---|
| IPartConventionsBuilder | A part builder allowing further configuration of the part. |
SelectConstructor(Func<IEnumerable<ConstructorInfo>, ConstructorInfo>, Action<ParameterInfo, IImportConventionsBuilder>)
Select which of the available constructors will be used to instantiate the part.
Declaration
public IPartConventionsBuilder SelectConstructor(Func<IEnumerable<ConstructorInfo>, ConstructorInfo> constructorSelector, Action<ParameterInfo, IImportConventionsBuilder> importConfiguration = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<System.Collections.Generic.IEnumerable<System.Reflection.ConstructorInfo>, System.Reflection.ConstructorInfo> | constructorSelector | Filter that selects a single constructor. |
| System.Action<System.Reflection.ParameterInfo, IImportConventionsBuilder> | importConfiguration | Action configuring the parameters of the selected constructor. |
Returns
| Type | Description |
|---|---|
| IPartConventionsBuilder | A part builder allowing further configuration of the part. |
Singleton()
Mark the part as being shared within the entire composition.
Declaration
public IPartConventionsBuilder Singleton()
Returns
| Type | Description |
|---|---|
| IPartConventionsBuilder | A part builder allowing further configuration of the part. |
Explicit Interface Implementations
| Improve this Doc View SourceIPartConventionsBuilder.AllowMultiple(Boolean)
Indicates that this service allows multiple registrations.
Declaration
IPartConventionsBuilder IPartConventionsBuilder.AllowMultiple(bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | value | True if multiple service registrations are allowed, false otherwise. |
Returns
| Type | Description |
|---|---|
| IPartConventionsBuilder | A part builder allowing further configuration of the part. |