CompositionContext.GetExports 方法

定義

多載

GetExports(Type)

擷取符合指定類型之所有匯出的集合。Retrieves a collection of all exports that match the specified type.

GetExports(Type, String)

擷取符合指定合約名稱與類型的所有匯出。Retrieves all exports that match the specified contract name and type.

GetExports<TExport>()

擷取符合指定泛型型別參數的所有匯出。Retrieves all exports that match the specified generic type parameter.

GetExports<TExport>(String)

擷取符合指定泛型型別參數與合約名稱的所有匯出。Retrieves all exports that match the specified generic type parameter and contract name.

GetExports(Type)

擷取符合指定類型之所有匯出的集合。Retrieves a collection of all exports that match the specified type.

public:
 System::Collections::Generic::IEnumerable<System::Object ^> ^ GetExports(Type ^ exportType);
public System.Collections.Generic.IEnumerable<object> GetExports (Type exportType);
member this.GetExports : Type -> seq<obj>
Public Function GetExports (exportType As Type) As IEnumerable(Of Object)

參數

exportType
Type

要符合的類型。The type to match.

傳回

匯出值的集合。A collection of exported values.

例外狀況

找不到 exportType 的匯出。No exports were found for exportType.

GetExports(Type, String)

擷取符合指定合約名稱與類型的所有匯出。Retrieves all exports that match the specified contract name and type.

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

參數

exportType
Type

要符合的類型。The type to match.

contractName
String

要比對的名稱。The name to match.

傳回

匯出值的集合。A collection of exported values.

例外狀況

找不到 exportType 的匯出。No exports were found for exportType.

GetExports<TExport>()

擷取符合指定泛型型別參數的所有匯出。Retrieves all exports that match the specified generic type parameter.

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

類型參數

TExport

要符合的類型。The type to match.

傳回

IEnumerable<TExport>

匯出值的集合。A collection of exported values.

例外狀況

找不到 TExport 的匯出。No exports were found for TExport.

GetExports<TExport>(String)

擷取符合指定泛型型別參數與合約名稱的所有匯出。Retrieves all exports that match the specified generic type parameter and contract name.

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

類型參數

TExport

要符合的類型。The type to match.

參數

contractName
String

要比對的名稱。The name to match.

傳回

IEnumerable<TExport>

匯出值的集合。A collection of exported values.

例外狀況

找不到 TExportcontractName 的匯出。No exports were found for TExport and contractName.

適用於