Edit

Share via


PartBuilder.SelectConstructor Method

Definition

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

Overloads

SelectConstructor(Func<ConstructorInfo[],ConstructorInfo>)

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

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

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

SelectConstructor(Func<ConstructorInfo[],ConstructorInfo>)

Source:
PartBuilder.cs
Source:
PartBuilder.cs
Source:
PartBuilder.cs
Source:
PartBuilder.cs

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

public:
 System::ComponentModel::Composition::Registration::PartBuilder ^ SelectConstructor(Func<cli::array <System::Reflection::ConstructorInfo ^> ^, System::Reflection::ConstructorInfo ^> ^ constructorFilter);
public System.ComponentModel.Composition.Registration.PartBuilder SelectConstructor (Func<System.Reflection.ConstructorInfo[],System.Reflection.ConstructorInfo> constructorFilter);
member this.SelectConstructor : Func<System.Reflection.ConstructorInfo[], System.Reflection.ConstructorInfo> -> System.ComponentModel.Composition.Registration.PartBuilder
Public Function SelectConstructor (constructorFilter As Func(Of ConstructorInfo(), ConstructorInfo)) As PartBuilder

Parameters

constructorFilter
Func<ConstructorInfo[],ConstructorInfo>

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

Returns

The current object, to allow chaining.

Exceptions

constructorFilter is null.

constructorFilter returns null.

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

Applies to

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

Source:
PartBuilder.cs
Source:
PartBuilder.cs
Source:
PartBuilder.cs
Source:
PartBuilder.cs

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

public:
 System::ComponentModel::Composition::Registration::PartBuilder ^ SelectConstructor(Func<cli::array <System::Reflection::ConstructorInfo ^> ^, System::Reflection::ConstructorInfo ^> ^ constructorFilter, Action<System::Reflection::ParameterInfo ^, System::ComponentModel::Composition::Registration::ImportBuilder ^> ^ importConfiguration);
public System.ComponentModel.Composition.Registration.PartBuilder SelectConstructor (Func<System.Reflection.ConstructorInfo[],System.Reflection.ConstructorInfo> constructorFilter, Action<System.Reflection.ParameterInfo,System.ComponentModel.Composition.Registration.ImportBuilder> importConfiguration);
member this.SelectConstructor : Func<System.Reflection.ConstructorInfo[], System.Reflection.ConstructorInfo> * Action<System.Reflection.ParameterInfo, System.ComponentModel.Composition.Registration.ImportBuilder> -> System.ComponentModel.Composition.Registration.PartBuilder
Public Function SelectConstructor (constructorFilter As Func(Of ConstructorInfo(), ConstructorInfo), importConfiguration As Action(Of ParameterInfo, ImportBuilder)) As PartBuilder

Parameters

constructorFilter
Func<ConstructorInfo[],ConstructorInfo>

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

importConfiguration
Action<ParameterInfo,ImportBuilder>

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

Returns

The current object, to allow chaining.

Exceptions

constructorFilter is null.

constructorFilter returns null.

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

Applies to