共用方式為


ExportProvider.TryGetExports 方法

定義

取得符合指定之匯入條件的所有匯出。

public:
 bool TryGetExports(System::ComponentModel::Composition::Primitives::ImportDefinition ^ definition, System::ComponentModel::Composition::Hosting::AtomicComposition ^ atomicComposition, [Runtime::InteropServices::Out] System::Collections::Generic::IEnumerable<System::ComponentModel::Composition::Primitives::Export ^> ^ % exports);
public bool TryGetExports (System.ComponentModel.Composition.Primitives.ImportDefinition definition, System.ComponentModel.Composition.Hosting.AtomicComposition atomicComposition, out System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export> exports);
public bool TryGetExports (System.ComponentModel.Composition.Primitives.ImportDefinition definition, System.ComponentModel.Composition.Hosting.AtomicComposition? atomicComposition, out System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export>? exports);
member this.TryGetExports : System.ComponentModel.Composition.Primitives.ImportDefinition * System.ComponentModel.Composition.Hosting.AtomicComposition * seq -> bool
Public Function TryGetExports (definition As ImportDefinition, atomicComposition As AtomicComposition, ByRef exports As IEnumerable(Of Export)) As Boolean

參數

definition
ImportDefinition

物件,此物件會定義要取得之 Export 物件的條件。

atomicComposition
AtomicComposition

用於撰寫的異動容器。

exports
IEnumerable<Export>

當此方法傳回時,包含符合 Export 定義條件的 ImportDefinition 物件集合 (如果有找到的話),否則,則為空的 IEnumerable<T> 物件。 這個參數會以未初始化的狀態傳遞。

傳回

CardinalityZeroOrOneZeroOrMore 且有零個 Export 物件符合指定 ImportDefinition 的條件,則為 true;若 CardinalityZeroOrOneExactlyOne 且有剛好一個 Export 符合指定 ImportDefinition 的條件,則為 true;否則為 false

例外狀況

definitionnull

適用於