ImportDefinition 构造函数

定义

初始化 ImportDefinition 类的新实例。

重载

ImportDefinition()

初始化 ImportDefinition 类的新实例。

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

使用指定的协定、协定名称、基数和指示导入定义是否可重新组合或是必备组件,初始化 ImportDefinition 类的新实例。

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

使用指定的协定、协定名称、基数、元数据和指示导入定义是否可重新组合或是必备组件,初始化 ImportDefinition 类的新实例。

ImportDefinition()

Source:
ImportDefinition.cs
Source:
ImportDefinition.cs
Source:
ImportDefinition.cs

初始化 ImportDefinition 类的新实例。

protected:
 ImportDefinition();
protected ImportDefinition ();
Protected Sub New ()

注解

调用此构造函数的派生类型必须重写 属性,还可以替代 ConstraintIsPrerequisiteIsRecomposable 属性(可选Cardinality)。

适用于

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

Source:
ImportDefinition.cs
Source:
ImportDefinition.cs
Source:
ImportDefinition.cs

使用指定的协定、协定名称、基数和指示导入定义是否可重新组合或是必备组件,初始化 ImportDefinition 类的新实例。

public:
 ImportDefinition(System::Linq::Expressions::Expression<Func<System::ComponentModel::Composition::Primitives::ExportDefinition ^, bool> ^> ^ constraint, System::String ^ contractName, System::ComponentModel::Composition::Primitives::ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite);
public ImportDefinition (System.Linq.Expressions.Expression<Func<System.ComponentModel.Composition.Primitives.ExportDefinition,bool>> constraint, string contractName, System.ComponentModel.Composition.Primitives.ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite);
public ImportDefinition (System.Linq.Expressions.Expression<Func<System.ComponentModel.Composition.Primitives.ExportDefinition,bool>> constraint, string? contractName, System.ComponentModel.Composition.Primitives.ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite);
new System.ComponentModel.Composition.Primitives.ImportDefinition : System.Linq.Expressions.Expression<Func<System.ComponentModel.Composition.Primitives.ExportDefinition, bool>> * string * System.ComponentModel.Composition.Primitives.ImportCardinality * bool * bool -> System.ComponentModel.Composition.Primitives.ImportDefinition
Public Sub New (constraint As Expression(Of Func(Of ExportDefinition, Boolean)), contractName As String, cardinality As ImportCardinality, isRecomposable As Boolean, isPrerequisite As Boolean)

参数

constraint
Expression<Func<ExportDefinition,Boolean>>

一个包含 Func<T,TResult> 对象的表达式,该对象定义 Export 若要满足导入定义必须匹配的条件。

contractName
String

协定名称。

cardinality
ImportCardinality

指示导入定义所需要的 Export 对象的基数的枚举值之一。

isRecomposable
Boolean

若指定在 ComposablePart 对象的整个生存期内可以多次满足导入定义,则为 true;否则为 false

isPrerequisite
Boolean

若指定必须在满足导入定义后 ComposablePart 才能开始生成导出的对象,则为 true;否则为 false

例外

constraintnull

cardinality 不是 ImportCardinality 值中的一个。

适用于

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

Source:
ImportDefinition.cs
Source:
ImportDefinition.cs
Source:
ImportDefinition.cs

使用指定的协定、协定名称、基数、元数据和指示导入定义是否可重新组合或是必备组件,初始化 ImportDefinition 类的新实例。

public:
 ImportDefinition(System::Linq::Expressions::Expression<Func<System::ComponentModel::Composition::Primitives::ExportDefinition ^, bool> ^> ^ constraint, System::String ^ contractName, System::ComponentModel::Composition::Primitives::ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite, System::Collections::Generic::IDictionary<System::String ^, System::Object ^> ^ metadata);
public ImportDefinition (System.Linq.Expressions.Expression<Func<System.ComponentModel.Composition.Primitives.ExportDefinition,bool>> constraint, string contractName, System.ComponentModel.Composition.Primitives.ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite, System.Collections.Generic.IDictionary<string,object> metadata);
public ImportDefinition (System.Linq.Expressions.Expression<Func<System.ComponentModel.Composition.Primitives.ExportDefinition,bool>> constraint, string? contractName, System.ComponentModel.Composition.Primitives.ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite, System.Collections.Generic.IDictionary<string,object?>? metadata);
new System.ComponentModel.Composition.Primitives.ImportDefinition : System.Linq.Expressions.Expression<Func<System.ComponentModel.Composition.Primitives.ExportDefinition, bool>> * string * System.ComponentModel.Composition.Primitives.ImportCardinality * bool * bool * System.Collections.Generic.IDictionary<string, obj> -> System.ComponentModel.Composition.Primitives.ImportDefinition
Public Sub New (constraint As Expression(Of Func(Of ExportDefinition, Boolean)), contractName As String, cardinality As ImportCardinality, isRecomposable As Boolean, isPrerequisite As Boolean, metadata As IDictionary(Of String, Object))

参数

constraint
Expression<Func<ExportDefinition,Boolean>>

一个包含 Func<T,TResult> 对象的表达式,该对象定义 Export 若要满足导入定义必须匹配的条件。

contractName
String

协定名称。

cardinality
ImportCardinality

指示导入定义所需要的 Export 对象的基数的枚举值之一。

isRecomposable
Boolean

若指定在 ComposablePart 对象的整个生存期内可以多次满足导入定义,则为 true;否则为 false

isPrerequisite
Boolean

若指定必须在满足导入定义后 ComposablePart 才能开始生成导出的对象,则为 true;否则为 false

metadata
IDictionary<String,Object>

与导入相关联的元数据。

适用于