ImportAttribute 构造函数

定义

初始化 ImportAttribute 类的新实例。

重载

ImportAttribute()

通过导入具有默认协定名称的导出,初始化 ImportAttribute 类的新实例。

ImportAttribute(String)

通过导入具有指定协定名称的导出,初始化 ImportAttribute 类的新实例。

ImportAttribute(Type)

通过导入具有派生自指定类型的协定名称的导出,初始化 ImportAttribute 类的新实例。

ImportAttribute(String, Type)

通过导入具有指定协定名称和类型的导出,初始化 ImportAttribute 类的新实例。

ImportAttribute()

通过导入具有默认协定名称的导出,初始化 ImportAttribute 类的新实例。

public:
 ImportAttribute();
public ImportAttribute ();
Public Sub New ()

注解

默认协定名称是在用此属性标记的属性、字段或参数类型上调用 GetContractName 方法的结果。

通过使用属性执行区分大小写的非语言比较来比较 Ordinal 协定名称。

适用于

ImportAttribute(String)

通过导入具有指定协定名称的导出,初始化 ImportAttribute 类的新实例。

public:
 ImportAttribute(System::String ^ contractName);
public ImportAttribute (string contractName);
public ImportAttribute (string? contractName);
new System.ComponentModel.Composition.ImportAttribute : string -> System.ComponentModel.Composition.ImportAttribute
Public Sub New (contractName As String)

参数

contractName
String

要导入的导出结果的协定名称,或 null 或空字符串 ("") 以使用默认协定名称。

注解

默认协定名称是在用此属性标记的属性、字段或参数类型上调用 GetContractName 方法的结果。

通过使用属性执行区分大小写的非语言比较来比较 Ordinal 协定名称。

适用于

ImportAttribute(Type)

通过导入具有派生自指定类型的协定名称的导出,初始化 ImportAttribute 类的新实例。

public:
 ImportAttribute(Type ^ contractType);
public ImportAttribute (Type contractType);
public ImportAttribute (Type? contractType);
new System.ComponentModel.Composition.ImportAttribute : Type -> System.ComponentModel.Composition.ImportAttribute
Public Sub New (contractType As Type)

参数

contractType
Type

要从中派生导出的协定名称的类型,或 null 以使用默认协定名称。

注解

协定名称是调用 GetContractName 方法时 contractType的结果。

默认协定名称是在用此属性标记的属性、字段或参数类型上调用 GetContractName 方法的结果。

通过使用属性执行区分大小写的非语言比较来比较 Ordinal 协定名称。

适用于

ImportAttribute(String, Type)

通过导入具有指定协定名称和类型的导出,初始化 ImportAttribute 类的新实例。

public:
 ImportAttribute(System::String ^ contractName, Type ^ contractType);
public ImportAttribute (string contractName, Type contractType);
public ImportAttribute (string? contractName, Type? contractType);
new System.ComponentModel.Composition.ImportAttribute : string * Type -> System.ComponentModel.Composition.ImportAttribute
Public Sub New (contractName As String, contractType As Type)

参数

contractName
String

要导入的导出结果的协定名称,或 null 或空字符串 ("") 以使用默认协定名称。

contractType
Type

要导入的导出结果的类型。

适用于