ComposablePartExportProvider.GetExportsCore(ImportDefinition, AtomicComposition) 方法

定义

获取此提供程序中与指定导入的条件匹配的所有导出的集合。Gets a collection of all exports in this provider that match the conditions of the specified import.

protected:
 override System::Collections::Generic::IEnumerable<System::ComponentModel::Composition::Primitives::Export ^> ^ GetExportsCore(System::ComponentModel::Composition::Primitives::ImportDefinition ^ definition, System::ComponentModel::Composition::Hosting::AtomicComposition ^ atomicComposition);
protected override System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export> GetExportsCore (System.ComponentModel.Composition.Primitives.ImportDefinition definition, System.ComponentModel.Composition.Hosting.AtomicComposition atomicComposition);
protected override System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export>? GetExportsCore (System.ComponentModel.Composition.Primitives.ImportDefinition definition, System.ComponentModel.Composition.Hosting.AtomicComposition? atomicComposition);
override this.GetExportsCore : System.ComponentModel.Composition.Primitives.ImportDefinition * System.ComponentModel.Composition.Hosting.AtomicComposition -> seq<System.ComponentModel.Composition.Primitives.Export>
Protected Overrides Function GetExportsCore (definition As ImportDefinition, atomicComposition As AtomicComposition) As IEnumerable(Of Export)

参数

definition
ImportDefinition

定义要获取的 ImportDefinition 条件的 ExportThe ImportDefinition that defines the conditions of the Export to get.

atomicComposition
AtomicComposition

要使用的组合事务,或为 null 以禁用事务性组合。The composition transaction to use, or null to disable transactional composition.

返回

IEnumerable<Export>

此提供程序中与指定条件匹配的所有导出的集合。A collection of all exports in this provider that match the specified conditions.

注解

实现者不应将与基数相关的不匹配视为错误,也不应为与基数相关的不匹配引发异常。Implementers should not treat cardinality-related mismatches as errors and should not throw exceptions for cardinality-related mismatches. 例如,如果导入只请求一个导出,且提供程序没有匹配的导出或多个导出,则该 GetExportsCore 方法应返回空 IEnumerable<T>Export 对象集合。For example, if the import requests exactly one export and the provider has no matching exports or more than one, the GetExportsCore method should return an empty IEnumerable<T> collection of Export objects.

适用于