CompositionHost.TryGetExport(CompositionContract, Object) 方法

定義

從組合內容擷取指定的匯出。Retrieves the specified export from the composition context.

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

參數

contract
CompositionContract

要擷取的匯出。The export to retrieve.

export
Object

當此方法傳回時,會包含匯出的執行個體 (如果可用的話);否則為 nullWhen this method returns, contains an instance of the export if available; otherwise, null.

傳回

如果已擷取匯出則為 true,否則為 falsetrue if the export was retrieved; otherwise, false.

例外狀況

匯出太多。There are too many exports.

適用於