Export 建構函式

定義

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

多載

Export()

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

Export(ExportDefinition, Func<Object>)

使用指定的匯出定義和匯出物件 getter,初始化 Export 類別的新執行個體。

Export(String, Func<Object>)

使用指定的合約名稱和匯出值 getter,初始化 Export 類別的新執行個體。

Export(String, IDictionary<String,Object>, Func<Object>)

使用指定的合約名稱、中繼資料和匯出值 getter,初始化 Export 類別的新執行個體。

Export()

來源:
Export.cs
來源:
Export.cs
來源:
Export.cs

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

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

備註

呼叫這個建構函式的衍生型別必須覆寫 Definition 屬性和 GetExportedValueCore 方法。

適用於

Export(ExportDefinition, Func<Object>)

來源:
Export.cs
來源:
Export.cs
來源:
Export.cs

使用指定的匯出定義和匯出物件 getter,初始化 Export 類別的新執行個體。

public:
 Export(System::ComponentModel::Composition::Primitives::ExportDefinition ^ definition, Func<System::Object ^> ^ exportedValueGetter);
public Export (System.ComponentModel.Composition.Primitives.ExportDefinition definition, Func<object> exportedValueGetter);
public Export (System.ComponentModel.Composition.Primitives.ExportDefinition definition, Func<object?> exportedValueGetter);
new System.ComponentModel.Composition.Primitives.Export : System.ComponentModel.Composition.Primitives.ExportDefinition * Func<obj> -> System.ComponentModel.Composition.Primitives.Export
Public Sub New (definition As ExportDefinition, exportedValueGetter As Func(Of Object))

參數

definition
ExportDefinition

物件,描述 Export 物件滿足的合約。

exportedValueGetter
Func<Object>

呼叫用來建立 Export 之已匯出物件的方法。 這會延遲建立物件,直到呼叫 Value 屬性為止。

例外狀況

definitionnull

-或-

exportedObjectGetternull

適用於

Export(String, Func<Object>)

來源:
Export.cs
來源:
Export.cs
來源:
Export.cs

使用指定的合約名稱和匯出值 getter,初始化 Export 類別的新執行個體。

public:
 Export(System::String ^ contractName, Func<System::Object ^> ^ exportedValueGetter);
public Export (string contractName, Func<object> exportedValueGetter);
public Export (string contractName, Func<object?> exportedValueGetter);
new System.ComponentModel.Composition.Primitives.Export : string * Func<obj> -> System.ComponentModel.Composition.Primitives.Export
Public Sub New (contractName As String, exportedValueGetter As Func(Of Object))

參數

contractName
String

Export 物件的合約名稱。

exportedValueGetter
Func<Object>

呼叫用來建立 Export 之已匯出物件的方法。 這會延遲建立物件,直到呼叫 Value 方法為止。

例外狀況

contractNamenull

-或-

exportedObjectGetternull

contractName 為空字串 ("")。

適用於

Export(String, IDictionary<String,Object>, Func<Object>)

來源:
Export.cs
來源:
Export.cs
來源:
Export.cs

使用指定的合約名稱、中繼資料和匯出值 getter,初始化 Export 類別的新執行個體。

public:
 Export(System::String ^ contractName, System::Collections::Generic::IDictionary<System::String ^, System::Object ^> ^ metadata, Func<System::Object ^> ^ exportedValueGetter);
public Export (string contractName, System.Collections.Generic.IDictionary<string,object> metadata, Func<object> exportedValueGetter);
public Export (string contractName, System.Collections.Generic.IDictionary<string,object?>? metadata, Func<object?> exportedValueGetter);
new System.ComponentModel.Composition.Primitives.Export : string * System.Collections.Generic.IDictionary<string, obj> * Func<obj> -> System.ComponentModel.Composition.Primitives.Export
Public Sub New (contractName As String, metadata As IDictionary(Of String, Object), exportedValueGetter As Func(Of Object))

參數

contractName
String

Export 物件的合約名稱。

metadata
IDictionary<String,Object>

Export 物件的中繼資料,或 null 以將 Metadata 屬性設為空白、唯讀 IDictionary<TKey,TValue> 物件。

exportedValueGetter
Func<Object>

呼叫用來建立 Export 之已匯出物件的方法。 這會延遲建立物件,直到呼叫 Value 方法為止。

例外狀況

contractNamenull

-或-

exportedObjectGetternull

contractName 為空字串 ("")。

適用於