ExportProvider.TryGetExports Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈