Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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

.NET Framework 4.6 and 4.5

Specifies the constructor that matching types should use as an importing constructor.

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

public PartBuilder SelectConstructor(
	Func<ConstructorInfo[], ConstructorInfo> constructorFilter
)

Parameters

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

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

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