ExportProvider.GetExportsCore(ImportDefinition, AtomicComposition) 方法

定义

获取与指定的定义所定义的约束匹配的所有导出。Gets all the exports that match the constraint defined by the specified definition.

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

参数

definition
ImportDefinition

定义要返回的 Export 对象的条件的对象。The object that defines the conditions of the Export objects to return.

atomicComposition
AtomicComposition

组合的事务性容器。The transactional container for the composition.

返回

IEnumerable<Export>

一个包含与指定的条件匹配的所有导出的集合。A collection that contains all the exports that match the specified condition.

注解

此方法的重写不应将与基数相关的不匹配视为错误,因此在这些情况下不应引发异常。Overrides of this method should not treat cardinality-related mismatches as errors, and should not throw exceptions in those cases. 例如,如果 Cardinality 为, ExactlyOne 并且存在 Export 与指定的条件匹配的零个对象,则 ImportDefinition IEnumerable<T> 应返回一个空集合。For example, if Cardinality is ExactlyOne and there are zero Export objects that match the conditions of the specified ImportDefinition, an empty IEnumerable<T> collection should be returned.

适用于