ExportProvider.TryGetExports(ImportDefinition, AtomicComposition, IEnumerable<Export>) ExportProvider.TryGetExports(ImportDefinition, AtomicComposition, IEnumerable<Export>) ExportProvider.TryGetExports(ImportDefinition, AtomicComposition, IEnumerable<Export>) Method

Definition

Gets all the exports that match the conditions of the specified import.

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);
member this.TryGetExports : System.ComponentModel.Composition.Primitives.ImportDefinition * System.ComponentModel.Composition.Hosting.AtomicComposition *  -> bool

Parameters

definition
ImportDefinition ImportDefinition ImportDefinition

The object that defines the conditions of the Export objects to get.

atomicComposition
AtomicComposition AtomicComposition AtomicComposition

The transactional container for the composition.

exports
IEnumerable<Export>

When this method returns, contains a collection of Export objects that match the conditions defined by ImportDefinition, if found; otherwise, an empty IEnumerable<T> object. This parameter is passed uninitialized.

Returns

true if Cardinality is ZeroOrOne or ZeroOrMore and there are zero Export objects that match the conditions of the specified ImportDefinition; true if Cardinality is ZeroOrOne or ExactlyOne and there is exactly one Export that matches the conditions of the specified ImportDefinition; otherwise, false.

Exceptions

Applies to