Export (0) Print
Expand All

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

Initializes a new instance of the ImportDefinition class with the specified constraint, contract name, cardinality, a value that indicates whether the import definition is recomposable, and a value that indicates whether the import definition is 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 ImportDefinition.
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 ImportDefinition.
isRecomposable
Type: System.Boolean
true to specify that the ImportDefinition can be satisfied multiple times throughout the lifetime of a ComposablePart object; otherwise, false.
isPrerequisite
Type: System.Boolean
true to specify that the ImportDefinition must be satisfied before a ComposablePart can start producing exported objects; otherwise, false.

ExceptionCondition
ArgumentNullException

constraint is null.

ArgumentException

cardinality is not one of the values of ImportCardinality.

Silverlight

Supported in: 5, 4

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft