Class MefPartBuilder
A MEF part builder.
Inheritance
Implements
Inherited Members
Namespace: Kephas.Composition.Mef.Conventions
Assembly: Kephas.Composition.Mef.dll
Syntax
public class MefPartBuilder : IPartBuilderConstructors
| Improve this Doc View SourceMefPartBuilder(Type, Func<ICompositionContext, Object>)
Initializes a new instance of the MefPartBuilder class.
Declaration
public MefPartBuilder(Type contractType, Func<ICompositionContext, object> instanceFactory)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Type | contractType | Type of the contract. | 
| System.Func<ICompositionContext, System.Object> | instanceFactory | The instance factory. | 
MefPartBuilder(Type, Object)
Initializes a new instance of the MefPartBuilder class.
Declaration
public MefPartBuilder(Type contractType, object instance)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Type | contractType | Type of the contract. | 
| System.Object | instance | The instance. | 
Properties
| Improve this Doc View SourceContractType
Gets the type of the contract.
Declaration
public Type ContractType { get; }Property Value
| Type | Description | 
|---|---|
| System.Type | The type of the contract. | 
Instance
Gets the instance.
Declaration
public object Instance { get; }Property Value
| Type | Description | 
|---|---|
| System.Object | The instance. | 
InstanceFactory
Gets the instance factory.
Declaration
public Func<ICompositionContext, object> InstanceFactory { get; }Property Value
| Type | Description | 
|---|---|
| System.Func<ICompositionContext, System.Object> | The instance factory. | 
IsScoped
Gets a value indicating whether this object is scoped.
Declaration
public bool IsScoped { get; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | True if this object is scoped, false if not. | 
IsSingleton
Gets a value indicating whether this object is shared.
Declaration
public bool IsSingleton { get; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | True if this object is shared, false if not. | 
Methods
| Improve this Doc View SourceScoped()
Mark the part as being shared within the scope.
Declaration
public IPartBuilder Scoped()Returns
| Type | Description | 
|---|---|
| IPartBuilder | A part builder allowing further configuration of the part. | 
Singleton()
Mark the part as being shared within the entire composition.
Declaration
public IPartBuilder Singleton()Returns
| Type | Description | 
|---|---|
| IPartBuilder | A part builder allowing further configuration of the part. | 
Explicit Interface Implementations
| Improve this Doc View SourceIPartBuilder.AllowMultiple(Boolean)
Indicates that this service allows multiple registrations.
Declaration
IPartBuilder IPartBuilder.AllowMultiple(bool value)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Boolean | value | True if multiple service registrations are allowed, false otherwise. | 
Returns
| Type | Description | 
|---|---|
| IPartBuilder | A part builder allowing further configuration of the part. |