ImportAttribute 建構函式

定義

初始化 ImportAttribute 類別的新執行個體。

多載

ImportAttribute()

使用預設合約名稱來匯入匯出集,初始化 ImportAttribute 類別的新執行個體。

ImportAttribute(String)

使用指定合約名稱來匯入匯出集,初始化 ImportAttribute 類別的新執行個體。

ImportAttribute(Type)

使用衍生自指定型別之合約名稱來匯入匯出,初始化 ImportAttribute 類別的新執行個體。

ImportAttribute(String, Type)

使用指定合約名稱和型別來匯入匯出集,初始化 ImportAttribute 類別的新執行個體。

ImportAttribute()

來源:
ImportAttribute.cs
來源:
ImportAttribute.cs
來源:
ImportAttribute.cs

使用預設合約名稱來匯入匯出集,初始化 ImportAttribute 類別的新執行個體。

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

備註

默認合約名稱是在屬性、欄位或參數類型上呼叫 GetContractName 方法的結果,這個類型會以此屬性標示。

合約名稱的比較方式是 Ordinal 使用 屬性來執行區分大小寫的非語言比較。

適用於

ImportAttribute(String)

來源:
ImportAttribute.cs
來源:
ImportAttribute.cs
來源:
ImportAttribute.cs

使用指定合約名稱來匯入匯出集,初始化 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.cs
來源:
ImportAttribute.cs
來源:
ImportAttribute.cs

使用衍生自指定型別之合約名稱來匯入匯出,初始化 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

備註

合約名稱是在上contractType呼叫 GetContractName 方法的結果。

默認合約名稱是呼叫 屬性、字段或參數類型上方法的結果 GetContractName ,而參數類型會以此屬性標示。

合約名稱的比較方式是 Ordinal 使用 屬性來執行區分大小寫的非語言比較。

適用於

ImportAttribute(String, Type)

來源:
ImportAttribute.cs
來源:
ImportAttribute.cs
來源:
ImportAttribute.cs

使用指定合約名稱和型別來匯入匯出集,初始化 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

要滙入的匯出類型。

適用於