ComposablePartCatalog.GetExports(ImportDefinition) 方法

定义

获取与指定的 ImportDefinition 对象所定义的约束相匹配的导出定义的列表。Gets a list of export definitions that match the constraint defined by the specified ImportDefinition object.

public:
 virtual System::Collections::Generic::IEnumerable<Tuple<System::ComponentModel::Composition::Primitives::ComposablePartDefinition ^, System::ComponentModel::Composition::Primitives::ExportDefinition ^> ^> ^ GetExports(System::ComponentModel::Composition::Primitives::ImportDefinition ^ definition);
public virtual System.Collections.Generic.IEnumerable<Tuple<System.ComponentModel.Composition.Primitives.ComposablePartDefinition,System.ComponentModel.Composition.Primitives.ExportDefinition>> GetExports (System.ComponentModel.Composition.Primitives.ImportDefinition definition);
abstract member GetExports : System.ComponentModel.Composition.Primitives.ImportDefinition -> seq<System.ComponentModel.Composition.Primitives.ComposablePartDefinition * System.ComponentModel.Composition.Primitives.ExportDefinition>
override this.GetExports : System.ComponentModel.Composition.Primitives.ImportDefinition -> seq<System.ComponentModel.Composition.Primitives.ComposablePartDefinition * System.ComponentModel.Composition.Primitives.ExportDefinition>
Public Overridable Function GetExports (definition As ImportDefinition) As IEnumerable(Of Tuple(Of ComposablePartDefinition, ExportDefinition))

参数

definition
ImportDefinition

要返回的 ExportDefinition 对象的条件。The conditions of the ExportDefinition objects to be returned.

返回

Tuple<T1,T2> 的集合,其中包含与 ExportDefinition 指定的约束相匹配的对象的 ComposablePartDefinition 对象及其关联的 definition 对象。A collection of Tuple<T1,T2> containing the ExportDefinition objects and their associated ComposablePartDefinition objects for objects that match the constraint specified by definition.

异常

ComposablePartCatalog 对象已被释放。The ComposablePartCatalog object has been disposed of.

definitionnulldefinition is null.

注解

此方法的重写绝不应返回 nullOverrides of this method should never return null. 如果没有 ExportDefinitiondefinition所定义的条件相匹配,则返回一个空的 IEnumerable<T> 对象。If no ExportDefinition matches the conditions defined by definition, return an empty IEnumerable<T> object.

适用于