Modifier

Partager via


ExportProvider.TryGetExports 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);
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

Parameters

definition
ImportDefinition

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

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

definition is null.

Applies to