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

.NET Framework (current version)
 

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.

Exception Condition
ArgumentNullException

constructorFilter is null.

ArgumentException

constructorFilter returns null.

InvalidOperationException

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

.NET Framework
Available since 4.5
Return to top
Show: