CompositionContext.TryGetExport 方法

定義

多載

TryGetExport(CompositionContract, Object)

傳回符合指定之合約的匯出,如果找不到相符項目則傳回 nullReturns the export that matches the specified contract, or returns null if no match is found.

TryGetExport(Type, Object)

傳回符合指定之類型的匯出,如果找不到相符項目則傳回 nullReturns the export that matches the specified type, or returns null if no match is found.

TryGetExport(Type, String, Object)

傳回符合指定之合約名稱及類型的匯出,如果找不到相符項目則傳回 nullReturns the export that matches the specified contract name and type, or returns null if no match is found.

TryGetExport<TExport>(TExport)

傳回符合指定之泛型類型參數的匯出,如果找不到相符項目則傳回 nullReturns the export that matches the specified generic type parameter, or returns null if no match is found.

TryGetExport<TExport>(String, TExport)

傳回符合指定之泛型類型參數及合約名稱的匯出,如果找不到相符項目則傳回 nullReturns the export that matches the specified generic type parameter and contract name, or returns null if no match is found.

TryGetExport(CompositionContract, Object)

傳回符合指定之合約的匯出,如果找不到相符項目則傳回 nullReturns the export that matches the specified contract, or returns null if no match is found.

public:
 abstract bool TryGetExport(System::Composition::Hosting::Core::CompositionContract ^ contract, [Runtime::InteropServices::Out] System::Object ^ % export);
public abstract bool TryGetExport (System.Composition.Hosting.Core.CompositionContract contract, out object export);
abstract member TryGetExport : System.Composition.Hosting.Core.CompositionContract * obj -> bool
Public MustOverride Function TryGetExport (contract As CompositionContract, ByRef export As Object) As Boolean

參數

contract
CompositionContract

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

export
Object

當這個方法傳回時,會包含相符的匯出或 nullWhen this method returns, contains the matched export or null.

傳回

如果找到匯出則為 true,否則為 falsetrue if an export was found; otherwise, false.

例外狀況

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

TryGetExport(Type, Object)

傳回符合指定之類型的匯出,如果找不到相符項目則傳回 nullReturns the export that matches the specified type, or returns null if no match is found.

public:
 bool TryGetExport(Type ^ exportType, [Runtime::InteropServices::Out] System::Object ^ % export);
public bool TryGetExport (Type exportType, out object export);
member this.TryGetExport : Type * obj -> bool
Public Function TryGetExport (exportType As Type, ByRef export As Object) As Boolean

參數

exportType
Type

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

export
Object

當這個方法傳回時,會包含相符的匯出或 nullWhen this method returns, contains the matched export or null.

傳回

如果找到匯出則為 true,否則為 falsetrue if an export was found; otherwise, false.

例外狀況

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

TryGetExport(Type, String, Object)

傳回符合指定之合約名稱及類型的匯出,如果找不到相符項目則傳回 nullReturns the export that matches the specified contract name and type, or returns null if no match is found.

public:
 bool TryGetExport(Type ^ exportType, System::String ^ contractName, [Runtime::InteropServices::Out] System::Object ^ % export);
public bool TryGetExport (Type exportType, string contractName, out object export);
member this.TryGetExport : Type * string * obj -> bool
Public Function TryGetExport (exportType As Type, contractName As String, ByRef export As Object) As Boolean

參數

exportType
Type

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

contractName
String

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

export
Object

當這個方法傳回時,會包含相符的匯出或 nullWhen this method returns, contains the matched export or null.

傳回

如果找到匯出則為 true,否則為 falsetrue if an export was found; otherwise, false.

例外狀況

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

TryGetExport<TExport>(TExport)

傳回符合指定之泛型類型參數的匯出,如果找不到相符項目則傳回 nullReturns the export that matches the specified generic type parameter, or returns null if no match is found.

public:
generic <typename TExport>
 bool TryGetExport([Runtime::InteropServices::Out] TExport % export);
public bool TryGetExport<TExport> (out TExport export);
member this.TryGetExport : 'Export -> bool
Public Function TryGetExport(Of TExport) (ByRef export As TExport) As Boolean

類型參數

TExport

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

參數

export
TExport

當這個方法傳回時,會包含相符的匯出或 nullWhen this method returns, contains the matched export or null.

傳回

如果找到匯出則為 true,否則為 falsetrue if an export was found; otherwise, false.

例外狀況

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

TryGetExport<TExport>(String, TExport)

傳回符合指定之泛型類型參數及合約名稱的匯出,如果找不到相符項目則傳回 nullReturns the export that matches the specified generic type parameter and contract name, or returns null if no match is found.

public:
generic <typename TExport>
 bool TryGetExport(System::String ^ contractName, [Runtime::InteropServices::Out] TExport % export);
public bool TryGetExport<TExport> (string contractName, out TExport export);
member this.TryGetExport : string * 'Export -> bool
Public Function TryGetExport(Of TExport) (contractName As String, ByRef export As TExport) As Boolean

類型參數

TExport

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

參數

contractName
String

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

export
TExport

當這個方法傳回時,會包含相符的匯出或 nullWhen this method returns, contains the matched export or null.

傳回

如果找到匯出則為 true,否則為 falsetrue if an export was found; otherwise, false.

例外狀況

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

適用於