ExportProvider.GetExports 方法

定義

取得符合指定條件的所有匯出。

多載

GetExports(ImportDefinition)

取得符合指定之匯入定義條件的所有匯出。

GetExports(ImportDefinition, AtomicComposition)

取得符合指定匯入定義和撰寫條件的所有匯出。

GetExports(Type, Type, String)

取得具有指定之合約名稱的所有匯出結果。

GetExports<T,TMetadataView>()

取得具有從指定型別參數衍生之合約名稱的所有匯出。

GetExports<T,TMetadataView>(String)

取得具有指定之合約名稱的所有匯出結果。

GetExports<T>()

取得具有從指定型別參數衍生之合約名稱的所有匯出。

GetExports<T>(String)

取得具有指定之合約名稱的所有匯出結果。

GetExports(ImportDefinition)

來源:
ExportProvider.cs
來源:
ExportProvider.cs
來源:
ExportProvider.cs

取得符合指定之匯入定義條件的所有匯出。

public:
 System::Collections::Generic::IEnumerable<System::ComponentModel::Composition::Primitives::Export ^> ^ GetExports(System::ComponentModel::Composition::Primitives::ImportDefinition ^ definition);
public System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export> GetExports (System.ComponentModel.Composition.Primitives.ImportDefinition definition);
member this.GetExports : System.ComponentModel.Composition.Primitives.ImportDefinition -> seq<System.ComponentModel.Composition.Primitives.Export>
Public Function GetExports (definition As ImportDefinition) As IEnumerable(Of Export)

參數

definition
ImportDefinition

物件,此物件會定義要取得之 Export 物件的條件。

傳回

一個集合,包含符合 definition 指定條件的所有 Export 物件。

例外狀況

CardinalityExactlyOne,而且沒有任何 Export 物件符合指定之 ImportDefinition 的條件。

-或-

CardinalityZeroOrOneExactlyOne,而且有一個以上的 Export 物件符合指定之 ImportDefinition 的條件。

definitionnull

適用於

GetExports(ImportDefinition, AtomicComposition)

來源:
ExportProvider.cs
來源:
ExportProvider.cs
來源:
ExportProvider.cs

取得符合指定匯入定義和撰寫條件的所有匯出。

public:
 System::Collections::Generic::IEnumerable<System::ComponentModel::Composition::Primitives::Export ^> ^ GetExports(System::ComponentModel::Composition::Primitives::ImportDefinition ^ definition, System::ComponentModel::Composition::Hosting::AtomicComposition ^ atomicComposition);
public System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export> GetExports (System.ComponentModel.Composition.Primitives.ImportDefinition definition, System.ComponentModel.Composition.Hosting.AtomicComposition atomicComposition);
public System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export> GetExports (System.ComponentModel.Composition.Primitives.ImportDefinition definition, System.ComponentModel.Composition.Hosting.AtomicComposition? atomicComposition);
member this.GetExports : System.ComponentModel.Composition.Primitives.ImportDefinition * System.ComponentModel.Composition.Hosting.AtomicComposition -> seq<System.ComponentModel.Composition.Primitives.Export>
Public Function GetExports (definition As ImportDefinition, atomicComposition As AtomicComposition) As IEnumerable(Of Export)

參數

definition
ImportDefinition

物件,此物件會定義要取得之 Export 物件的條件。

atomicComposition
AtomicComposition

用於撰寫的異動容器。

傳回

一個集合,包含符合 definitionatomicComposition 指定條件的所有 Export 物件。

例外狀況

CardinalityExactlyOne,而且沒有任何 Export 物件符合指定之 ImportDefinition 的條件。

-或-

CardinalityZeroOrOneExactlyOne,而且有一個以上的 Export 物件符合指定之 ImportDefinition 的條件。

definitionnull

-或-

atomicCompositionnull

適用於

GetExports(Type, Type, String)

來源:
ExportProvider.GetExportOverrides.cs
來源:
ExportProvider.GetExportOverrides.cs
來源:
ExportProvider.GetExportOverrides.cs

取得具有指定之合約名稱的所有匯出結果。

public:
 System::Collections::Generic::IEnumerable<Lazy<System::Object ^, System::Object ^> ^> ^ GetExports(Type ^ type, Type ^ metadataViewType, System::String ^ contractName);
public System.Collections.Generic.IEnumerable<Lazy<object,object>> GetExports (Type type, Type metadataViewType, string contractName);
public System.Collections.Generic.IEnumerable<Lazy<object,object>> GetExports (Type type, Type? metadataViewType, string? contractName);
member this.GetExports : Type * Type * string -> seq<Lazy<obj, obj>>
Public Function GetExports (type As Type, metadataViewType As Type, contractName As String) As IEnumerable(Of Lazy(Of Object, Object))

參數

type
Type

要傳回之 Lazy<T,TMetadata> 物件的型別參數。

metadataViewType
Type

要傳回的 Lazy<T,TMetadata> 物件中繼資料檢視的型別。

contractName
String

要傳回的 Lazy<T,TMetadata> 物件的合約名稱,或者是 null,或者是要使用預設合約名稱的空字串 ("")。

傳回

一個集合,包含符合 contractName 之合約的所有 Lazy<T,TMetadata> 物件。

例外狀況

typenull

metadataViewType 不是有效的中繼資料檢視型別。

備註

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

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

適用於

GetExports<T,TMetadataView>()

來源:
ExportProvider.GetExportOverrides.cs
來源:
ExportProvider.GetExportOverrides.cs
來源:
ExportProvider.GetExportOverrides.cs

取得具有從指定型別參數衍生之合約名稱的所有匯出。

public:
generic <typename T, typename TMetadataView>
 System::Collections::Generic::IEnumerable<Lazy<T, TMetadataView> ^> ^ GetExports();
public System.Collections.Generic.IEnumerable<Lazy<T,TMetadataView>> GetExports<T,TMetadataView> ();
member this.GetExports : unit -> seq<Lazy<'T, 'MetadataView>>
Public Function GetExports(Of T, TMetadataView) () As IEnumerable(Of Lazy(Of T, TMetadataView))

類型參數

T

要傳回之 Lazy<T,TMetadata> 物件的型別參數。 合約名稱也是從這個型別參數衍生。

TMetadataView

要傳回的 Lazy<T,TMetadata> 物件中繼資料檢視的型別。

傳回

IEnumerable<Lazy<T,TMetadataView>>

則為具有從 T 衍生之合約名稱的 Lazy<T,TMetadata> 物件 (如果找到的話),否則,為空白 IEnumerable<T> 物件。

例外狀況

TMetadataView 不是有效的中繼資料檢視型別。

備註

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

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

適用於

GetExports<T,TMetadataView>(String)

來源:
ExportProvider.GetExportOverrides.cs
來源:
ExportProvider.GetExportOverrides.cs
來源:
ExportProvider.GetExportOverrides.cs

取得具有指定之合約名稱的所有匯出結果。

public:
generic <typename T, typename TMetadataView>
 System::Collections::Generic::IEnumerable<Lazy<T, TMetadataView> ^> ^ GetExports(System::String ^ contractName);
public System.Collections.Generic.IEnumerable<Lazy<T,TMetadataView>> GetExports<T,TMetadataView> (string contractName);
public System.Collections.Generic.IEnumerable<Lazy<T,TMetadataView>> GetExports<T,TMetadataView> (string? contractName);
member this.GetExports : string -> seq<Lazy<'T, 'MetadataView>>
Public Function GetExports(Of T, TMetadataView) (contractName As String) As IEnumerable(Of Lazy(Of T, TMetadataView))

類型參數

T

要傳回之 Lazy<T,TMetadata> 物件的型別參數。 合約名稱也是從這個型別參數衍生。

TMetadataView

要傳回的 Lazy<T,TMetadata> 物件中繼資料檢視的型別。

參數

contractName
String

要傳回的 Lazy<T,TMetadata> 物件的合約名稱,或者是 null,或者是要使用預設合約名稱的空字串 ("")。

傳回

IEnumerable<Lazy<T,TMetadataView>>

具有指定合約名稱的 Lazy<T,TMetadata> 物件 (如果找到的話),否則,為空白 IEnumerable<T> 物件。

例外狀況

TMetadataView 不是有效的中繼資料檢視型別。

備註

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

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

適用於

GetExports<T>()

來源:
ExportProvider.GetExportOverrides.cs
來源:
ExportProvider.GetExportOverrides.cs
來源:
ExportProvider.GetExportOverrides.cs

取得具有從指定型別參數衍生之合約名稱的所有匯出。

public:
generic <typename T>
 System::Collections::Generic::IEnumerable<Lazy<T> ^> ^ GetExports();
public System.Collections.Generic.IEnumerable<Lazy<T>> GetExports<T> ();
member this.GetExports : unit -> seq<Lazy<'T>>
Public Function GetExports(Of T) () As IEnumerable(Of Lazy(Of T))

類型參數

T

要傳回之 Lazy<T> 物件的型別參數。 合約名稱也是從這個型別參數衍生。

傳回

則為具有從 T 衍生之合約名稱的 Lazy<T> 物件 (如果找到的話),否則,為空白 IEnumerable<T> 物件。

例外狀況

備註

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

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

適用於

GetExports<T>(String)

來源:
ExportProvider.GetExportOverrides.cs
來源:
ExportProvider.GetExportOverrides.cs
來源:
ExportProvider.GetExportOverrides.cs

取得具有指定之合約名稱的所有匯出結果。

public:
generic <typename T>
 System::Collections::Generic::IEnumerable<Lazy<T> ^> ^ GetExports(System::String ^ contractName);
public System.Collections.Generic.IEnumerable<Lazy<T>> GetExports<T> (string contractName);
public System.Collections.Generic.IEnumerable<Lazy<T>> GetExports<T> (string? contractName);
member this.GetExports : string -> seq<Lazy<'T>>
Public Function GetExports(Of T) (contractName As String) As IEnumerable(Of Lazy(Of T))

類型參數

T

要傳回之 Lazy<T> 物件的型別參數。

參數

contractName
String

要傳回的 Lazy<T> 物件的合約名稱,或者是 null,或者是要使用預設合約名稱的空字串 ("")。

傳回

則為具有指定合約名稱的 Lazy<T> 物件 (如果找到的話),否則,為空白 IEnumerable<T> 物件。

例外狀況

備註

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

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

適用於