ExportProvider.GetExport 方法

定義

取得指定的匯出。Gets a specified export.

多載

GetExport<T,TMetadataView>()

傳回具有從指定型別參數中衍生之合約名稱的匯出。Returns the export with the contract name derived from the specified type parameter. 如果沒有任何項目完全符合匯出結果,則擲回例外狀況。If there is not exactly one matching export, an exception is thrown.

GetExport<T,TMetadataView>(String)

傳回具有指定合約名稱的匯出。Returns the export with the specified contract name. 如果沒有任何項目完全符合匯出結果,則擲回例外狀況。If there is not exactly one matching export, an exception is thrown.

GetExport<T>()

傳回具有從指定型別參數中衍生之合約名稱的匯出。Returns the export with the contract name derived from the specified type parameter. 如果沒有任何項目完全符合匯出結果,則擲回例外狀況。If there is not exactly one matching export, an exception is thrown.

GetExport<T>(String)

傳回具有指定合約名稱的匯出。Returns the export with the specified contract name. 如果沒有任何項目完全符合匯出結果,則擲回例外狀況。If there is not exactly one matching export, an exception is thrown.

GetExport<T,TMetadataView>()

傳回具有從指定型別參數中衍生之合約名稱的匯出。Returns the export with the contract name derived from the specified type parameter. 如果沒有任何項目完全符合匯出結果,則擲回例外狀況。If there is not exactly one matching export, an exception is thrown.

public:
generic <typename T, typename TMetadataView>
 Lazy<T, TMetadataView> ^ GetExport();
public Lazy<T,TMetadataView> GetExport<T,TMetadataView> ();
member this.GetExport : unit -> Lazy<'T, 'MetadataView>
Public Function GetExport(Of T, TMetadataView) () As Lazy(Of T, TMetadataView)

類型參數

T

要傳回之 Lazy<T,TMetadata> 物件的型別參數。The type parameter of the Lazy<T,TMetadata> object to return. 合約名稱也是從這個型別參數衍生。The contract name is also derived from this type parameter.

TMetadataView

要傳回的 Lazy<T,TMetadata> 物件中繼資料檢視的型別。The type of the metadata view of the Lazy<T,TMetadata> object to return.

傳回

Lazy<T,TMetadataView>

System.Lazy`2System.Lazy`2

例外狀況

沒有任何具有合約名稱的 Lazy<T,TMetadata> 物件衍生自 T 物件中的 CompositionContainerThere are zero Lazy<T,TMetadata> objects with the contract name derived from T in the CompositionContainer object.

-或--or- 有一個以上具有合約名稱的 Lazy<T,TMetadata> 物件衍生自 T 物件中的 CompositionContainerThere is more than one Lazy<T,TMetadata> object with the contract name derived from T in the CompositionContainer object.

CompositionContainer 物件已經處置。The CompositionContainer object has been disposed of.

TMetadataView 不是有效的中繼資料檢視型別。TMetadataView is not a valid metadata view type.

備註

合約名稱是在 T上呼叫 GetContractName 方法的結果。The contract name is the result of calling the GetContractName method on T.

合約名稱會藉由使用 Ordinal 屬性來進行比較,以執行區分大小寫的非語言比較。The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.

GetExport<T,TMetadataView>(String)

傳回具有指定合約名稱的匯出。Returns the export with the specified contract name. 如果沒有任何項目完全符合匯出結果,則擲回例外狀況。If there is not exactly one matching export, an exception is thrown.

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

類型參數

T

要傳回之 Lazy<T,TMetadata> 物件的型別參數。The type parameter of the Lazy<T,TMetadata> object to return.

TMetadataView

要傳回的 Lazy<T,TMetadata> 物件中繼資料檢視的型別。The type of the metadata view of the Lazy<T,TMetadata> object to return.

參數

contractName
String

要傳回的 Lazy<T,TMetadata> 物件的合約名稱,或者是 null,或者是要使用預設合約名稱的空字串 ("")。The contract name of the Lazy<T,TMetadata> object to return, or null or an empty string ("") to use the default contract name.

傳回

Lazy<T,TMetadataView>

具有指定合約名稱的匯出。The export with the specified contract name.

例外狀況

沒有任何具有合約名稱的 Lazy<T,TMetadata> 物件衍生自 T 物件中的 CompositionContainerThere are zero Lazy<T,TMetadata> objects with the contract name derived from T in the CompositionContainer object.

-或--or- 有一個以上具有合約名稱的 Lazy<T,TMetadata> 物件衍生自 T 物件中的 CompositionContainerThere is more than one Lazy<T,TMetadata> object with the contract name derived from T in the CompositionContainer object.

CompositionContainer 物件已經處置。The CompositionContainer object has been disposed of.

TMetadataView 不是有效的中繼資料檢視型別。TMetadataView is not a valid metadata view type.

備註

預設的合約名稱是在 T上呼叫 GetContractName 方法的結果。The default contract name is the result of calling the GetContractName method on T.

合約名稱會藉由使用 Ordinal 屬性來進行比較,以執行區分大小寫的非語言比較。The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.

GetExport<T>()

傳回具有從指定型別參數中衍生之合約名稱的匯出。Returns the export with the contract name derived from the specified type parameter. 如果沒有任何項目完全符合匯出結果,則擲回例外狀況。If there is not exactly one matching export, an exception is thrown.

public:
generic <typename T>
 Lazy<T> ^ GetExport();
public Lazy<T> GetExport<T> ();
member this.GetExport : unit -> Lazy<'T>
Public Function GetExport(Of T) () As Lazy(Of T)

類型參數

T

要傳回之 Lazy<T> 物件的型別參數。The type parameter of the Lazy<T> object to return. 合約名稱也是從這個型別參數衍生。The contract name is also derived from this type parameter.

傳回

具有從指定型別參數中衍生之合約名稱的匯出。The export with the contract name derived from the specified type parameter.

例外狀況

沒有任何具有合約名稱的 Lazy<T> 物件衍生自 T 物件中的 CompositionContainerThere are zero Lazy<T> objects with the contract name derived from T in the CompositionContainer object.

-或--or- 有一個以上具有合約名稱的 Lazy<T> 物件衍生自 T 物件中的 CompositionContainerThere is more than one Lazy<T> object with the contract name derived from T in the CompositionContainer object.

CompositionContainer 物件已經處置。The CompositionContainer object has been disposed of.

備註

合約名稱是在 T上呼叫 GetContractName 方法的結果。The contract name is the result of calling the GetContractName method on T.

合約名稱會藉由使用 Ordinal 屬性來進行比較,以執行區分大小寫的非語言比較。The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.

GetExport<T>(String)

傳回具有指定合約名稱的匯出。Returns the export with the specified contract name. 如果沒有任何項目完全符合匯出結果,則擲回例外狀況。If there is not exactly one matching export, an exception is thrown.

public:
generic <typename T>
 Lazy<T> ^ GetExport(System::String ^ contractName);
public Lazy<T> GetExport<T> (string contractName);
member this.GetExport : string -> Lazy<'T>
Public Function GetExport(Of T) (contractName As String) As Lazy(Of T)

類型參數

T

要傳回之 Lazy<T> 物件的型別參數。The type parameter of the Lazy<T> object to return.

參數

contractName
String

要傳回的 Lazy<T> 物件的合約名稱,或者是 null,或者是要使用預設合約名稱的空字串 ("")。The contract name of the Lazy<T> object to return, or null or an empty string ("") to use the default contract name.

傳回

具有指定合約名稱的匯出。The export with the specified contract name.

例外狀況

沒有任何具有合約名稱的 Lazy<T> 物件衍生自 T 物件中的 CompositionContainerThere are zero Lazy<T> objects with the contract name derived from T in the CompositionContainer object.

-或--or- 有一個以上具有合約名稱的 Lazy<T> 物件衍生自 T 物件中的 CompositionContainerThere is more than one Lazy<T> object with the contract name derived from T in the CompositionContainer object.

CompositionContainer 物件已經處置。The CompositionContainer object has been disposed of.

備註

預設的合約名稱是在 T上呼叫 GetContractName 方法的結果。The default contract name is the result of calling the GetContractName method on T.

合約名稱會藉由使用 Ordinal 屬性來進行比較,以執行區分大小寫的非語言比較。The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.

適用於