CompositionContext.GetExport 方法

定義

多載

GetExport(CompositionContract)

擷取符合指定合約的匯出。Retrieves the export that matches the specified contract.

GetExport(Type)

擷取符合指定類型的匯出。Retrieves the export that matches the specified type.

GetExport(Type, String)

擷取符合指定名稱與類型的匯出。Retrieves the export that matches the specified name and type.

GetExport<TExport>()

擷取符合指定泛型型別參數的匯出。Retrieves the export that matches the specified generic type parameter.

GetExport<TExport>(String)

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

GetExport(CompositionContract)

擷取符合指定合約的匯出。Retrieves the export that matches the specified contract.

public:
 System::Object ^ GetExport(System::Composition::Hosting::Core::CompositionContract ^ contract);
public object GetExport (System.Composition.Hosting.Core.CompositionContract contract);
member this.GetExport : System.Composition.Hosting.Core.CompositionContract -> obj
Public Function GetExport (contract As CompositionContract) As Object

參數

contract
CompositionContract

要比對的合約。The contract to match.

傳回

匯出值。The exported value.

例外狀況

找不到 contract 的匯出。No export was found for contract.

GetExport(Type)

擷取符合指定類型的匯出。Retrieves the export that matches the specified type.

public:
 System::Object ^ GetExport(Type ^ exportType);
public object GetExport (Type exportType);
member this.GetExport : Type -> obj
Public Function GetExport (exportType As Type) As Object

參數

exportType
Type

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

傳回

匯出值。The exported value.

例外狀況

找不到 exportType 的匯出。No export was found for exportType.

GetExport(Type, String)

擷取符合指定名稱與類型的匯出。Retrieves the export that matches the specified name and type.

public:
 System::Object ^ GetExport(Type ^ exportType, System::String ^ contractName);
public object GetExport (Type exportType, string contractName);
member this.GetExport : Type * string -> obj
Public Function GetExport (exportType As Type, contractName As String) As Object

參數

exportType
Type

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

contractName
String

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

傳回

匯出值。The exported value.

例外狀況

找不到 exportTypecontractName 的匯出。No export was found for exportType and contractName.

GetExport<TExport>()

擷取符合指定泛型型別參數的匯出。Retrieves the export that matches the specified generic type parameter.

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

類型參數

TExport

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

傳回

TExport

匯出值。The exported value.

例外狀況

找不到 TExport 的匯出。No export was found for TExport.

GetExport<TExport>(String)

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

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

類型參數

TExport

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

參數

contractName
String

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

傳回

TExport

匯出值。The exported value.

例外狀況

找不到 TExportcontractName 的匯出。No export was found for TExport and contractName.

適用於