CompositionContext.GetExports 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
GetExports(Type) |
擷取符合指定類型之所有匯出的集合。 |
GetExports(Type, String) |
擷取符合指定合約名稱與類型的所有匯出。 |
GetExports<TExport>() |
擷取符合指定泛型型別參數的所有匯出。 |
GetExports<TExport>(String) |
擷取符合指定泛型型別參數與合約名稱的所有匯出。 |
GetExports(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
要符合的類型。
傳回
匯出值的集合。
例外狀況
找不到 exportType
的匯出。
適用於
GetExports(Type, String)
擷取符合指定合約名稱與類型的所有匯出。
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
要符合的類型。
- contractName
- String
要比對的名稱。
傳回
匯出值的集合。
例外狀況
找不到 exportType
的匯出。
適用於
GetExports<TExport>()
擷取符合指定泛型型別參數的所有匯出。
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
要符合的類型。
傳回
IEnumerable<TExport>
匯出值的集合。
例外狀況
找不到 TExport
的匯出。
適用於
GetExports<TExport>(String)
擷取符合指定泛型型別參數與合約名稱的所有匯出。
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
要符合的類型。
參數
- contractName
- String
要比對的名稱。
傳回
IEnumerable<TExport>
匯出值的集合。
例外狀況
找不到 TExport
和 contractName
的匯出。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應