Export (0) Print
Expand All

PartBuilder.SelectConstructor Method (Func<ConstructorInfo[], ConstructorInfo>, Action<ParameterInfo, ImportBuilder>)

.NET Framework 4.6 and 4.5

Specifies the constructor that matching types should use as an importing constructor, and provides configuration information for the resulting import.

Namespace:  System.ComponentModel.Composition.Registration
Assembly:  System.ComponentModel.Composition.Registration (in System.ComponentModel.Composition.Registration.dll)

public PartBuilder SelectConstructor(
	Func<ConstructorInfo[], ConstructorInfo> constructorFilter,
	Action<ParameterInfo, ImportBuilder> importConfiguration
)

Parameters

constructorFilter
Type: System.Func<ConstructorInfo[], ConstructorInfo>

A function that chooses one constructor from a set of constructors.

importConfiguration
Type: System.Action<ParameterInfo, ImportBuilder>

An object that contains configuration information for the importing constructor. The default is null.

Return Value

Type: System.ComponentModel.Composition.Registration.PartBuilder
The current object, to allow chaining.

ExceptionCondition
ArgumentNullException

constructorFilter is null.

ArgumentException

constructorFilter returns null.

InvalidOperationException

constructorFilter returns a constructor that is not associated with the target type.

.NET Framework

Supported in: 4.6, 4.5
Show:
© 2015 Microsoft