ImportDefinition Constructor (Expression<Func<ExportDefinition, Boolean>>, String, ImportCardinality, Boolean, Boolean)
Microsoft Silverlight will reach end of support after October 2021. Learn more.
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)
Syntax
'Declaration
Public Sub New ( _
constraint As Expression(Of Func(Of ExportDefinition, Boolean)), _
contractName As String, _
cardinality As ImportCardinality, _
isRecomposable As Boolean, _
isPrerequisite As Boolean _
)
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.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | constraint is nulla null reference (Nothing in Visual Basic). |
ArgumentException | cardinality is not one of the values of ImportCardinality. |
Version Information
Silverlight
Supported in: 5, 4
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.