ImportDefinition Constructor (Expression<Func<ExportDefinition, Boolean>>, String, ImportCardinality, Boolean, Boolean)

 

Initializes a new instance of the ImportDefinition class with the specified constraint, contract name, and cardinality, and indicates whether the import definition is recomposable or a prerequisite.

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

public ImportDefinition(
	Expression<Func<ExportDefinition, bool>> constraint,
	string contractName,
	ImportCardinality cardinality,
	bool isRecomposable,
	bool isPrerequisite
)

Parameters

constraint
Type: System.Linq.Expressions.Expression<Func<ExportDefinition, Boolean>>

An expression that contains a Func<T, TResult> object that defines the conditions an Export must match to satisfy the import definition.

contractName
Type: System.String

The contract name.

cardinality
Type: System.ComponentModel.Composition.Primitives.ImportCardinality

One of the enumeration values that indicates the cardinality of the Export objects required by the import definition.

isRecomposable
Type: System.Boolean

true to specify that the import definition can be satisfied multiple times throughout the lifetime of a ComposablePart object; otherwise, false.

isPrerequisite
Type: System.Boolean

true to specify that the import definition must be satisfied before a ComposablePart can start producing exported objects; otherwise, false.

Exception Condition
ArgumentNullException

constraint is null.

ArgumentException

cardinality is not one of the values of ImportCardinality.

.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Return to top
Show: