ExportProvider.GetExports 方法
定义
获取与指定的条件匹配的所有导出。Gets all the exports matching the specified conditions.
重载
| GetExports(ImportDefinition) |
获取与指定的导入定义条件匹配的所有导出。Gets all exports that match the conditions of the specified import definition. |
| GetExports(ImportDefinition, AtomicComposition) |
获取与指定的导入定义和组合条件匹配的所有导出。Gets all exports that match the conditions of the specified import definition and composition. |
| GetExports(Type, Type, String) |
获取具有指定的协定名称的所有导出。Gets all the exports with the specified contract name. |
| GetExports<T,TMetadataView>() |
获取具有从指定的类型参数派生的协定名称的所有导出。Gets all the exports with the contract name derived from the specified type parameter. |
| GetExports<T,TMetadataView>(String) |
获取具有指定的协定名称的所有导出。Gets all the exports with the specified contract name. |
| GetExports<T>() |
获取具有从指定的类型参数派生的协定名称的所有导出。Gets all the exports with the contract name derived from the specified type parameter. |
| GetExports<T>(String) |
获取具有指定的协定名称的所有导出。Gets all the exports with the specified contract name. |
GetExports(ImportDefinition)
获取与指定的导入定义条件匹配的所有导出。Gets all exports that match the conditions of the specified import definition.
public:
System::Collections::Generic::IEnumerable<System::ComponentModel::Composition::Primitives::Export ^> ^ GetExports(System::ComponentModel::Composition::Primitives::ImportDefinition ^ definition);
public System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export> GetExports (System.ComponentModel.Composition.Primitives.ImportDefinition definition);
member this.GetExports : System.ComponentModel.Composition.Primitives.ImportDefinition -> seq<System.ComponentModel.Composition.Primitives.Export>
Public Function GetExports (definition As ImportDefinition) As IEnumerable(Of Export)
参数
- definition
- ImportDefinition
定义要获取的 Export 对象的条件的对象。The object that defines the conditions of the Export objects to get.
返回
与 definition 指定的条件匹配的所有 Export 对象的集合。A collection of all the Export objects matching the condition specified by definition.
例外
Cardinality 为 ExactlyOne,且没有任何 Export 对象与指定的 ImportDefinition 的条件匹配。Cardinality is ExactlyOne and there are zero Export objects that match the conditions of the specified ImportDefinition.
- 或 --or- Cardinality 为 ZeroOrOne 或 ExactlyOne,且有多个 Export 对象与指定的 ImportDefinition 的条件匹配。Cardinality is ZeroOrOne or ExactlyOne and there is more than one Export object that matches the conditions of the specified ImportDefinition.
definition 为 null。definition is null.
适用于
GetExports(ImportDefinition, AtomicComposition)
获取与指定的导入定义和组合条件匹配的所有导出。Gets all exports that match the conditions of the specified import definition and composition.
public:
System::Collections::Generic::IEnumerable<System::ComponentModel::Composition::Primitives::Export ^> ^ GetExports(System::ComponentModel::Composition::Primitives::ImportDefinition ^ definition, System::ComponentModel::Composition::Hosting::AtomicComposition ^ atomicComposition);
public System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export> GetExports (System.ComponentModel.Composition.Primitives.ImportDefinition definition, System.ComponentModel.Composition.Hosting.AtomicComposition atomicComposition);
public System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export> GetExports (System.ComponentModel.Composition.Primitives.ImportDefinition definition, System.ComponentModel.Composition.Hosting.AtomicComposition? atomicComposition);
member this.GetExports : System.ComponentModel.Composition.Primitives.ImportDefinition * System.ComponentModel.Composition.Hosting.AtomicComposition -> seq<System.ComponentModel.Composition.Primitives.Export>
Public Function GetExports (definition As ImportDefinition, atomicComposition As AtomicComposition) As IEnumerable(Of Export)
参数
- definition
- ImportDefinition
定义要获取的 Export 对象的条件的对象。The object that defines the conditions of the Export objects to get.
- atomicComposition
- AtomicComposition
组合的事务性容器。The transactional container for the composition.
返回
与 definition 和 atomicComposition 指定的条件匹配的所有 Export 对象的集合。A collection of all the Export objects matching the condition specified by definition and atomicComposition.
例外
Cardinality 为 ExactlyOne,且没有任何 Export 对象与指定的 ImportDefinition 的条件匹配。Cardinality is ExactlyOne and there are zero Export objects that match the conditions of the specified ImportDefinition.
- 或 --or- Cardinality 为 ZeroOrOne 或 ExactlyOne,且有多个 Export 对象与指定的 ImportDefinition 的条件匹配。Cardinality is ZeroOrOne or ExactlyOne and there is more than one Export object that matches the conditions of the specified ImportDefinition.
definition 为 null。definition is null.
- 或 --or-
atomicComposition 为 null。atomicComposition is null.
适用于
GetExports(Type, Type, String)
获取具有指定的协定名称的所有导出。Gets all the exports with the specified contract name.
public:
System::Collections::Generic::IEnumerable<Lazy<System::Object ^, System::Object ^> ^> ^ GetExports(Type ^ type, Type ^ metadataViewType, System::String ^ contractName);
public System.Collections.Generic.IEnumerable<Lazy<object,object>> GetExports (Type type, Type metadataViewType, string contractName);
public System.Collections.Generic.IEnumerable<Lazy<object,object>> GetExports (Type type, Type? metadataViewType, string? contractName);
member this.GetExports : Type * Type * string -> seq<Lazy<obj, obj>>
Public Function GetExports (type As Type, metadataViewType As Type, contractName As String) As IEnumerable(Of Lazy(Of Object, Object))
参数
- type
- Type
要返回的 Lazy<T,TMetadata> 对象的类型参数。The type parameter of the Lazy<T,TMetadata> objects to return.
- metadataViewType
- Type
要返回的 Lazy<T,TMetadata> 对象的元数据视图的类型。The type of the metadata view of the Lazy<T,TMetadata> objects to return.
- contractName
- String
要返回的 Lazy<T,TMetadata> 对象的协定名称,或者为 null 或空字符串 ("") 以使用默认的协定名称。The contract name of the Lazy<T,TMetadata> object to return, or null or an empty string ("") to use the default contract name.
返回
匹配 contractName 的协定的所有 Lazy<T,TMetadata> 对象的集合。A collection of all the Lazy<T,TMetadata> objects for the contract matching contractName.
例外
CompositionContainer 对象已被释放。The CompositionContainer object has been disposed of.
type 为 null。type is null.
metadataViewType 不是有效的元数据视图类型。metadataViewType is not a valid metadata view type.
注解
默认协定名称是对调用方法的结果 GetContractName type 。The default contract name is the result of calling the GetContractName method on type.
通过使用 Ordinal 属性执行区分大小写的非语言比较,对协定名称进行比较。The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.
适用于
GetExports<T,TMetadataView>()
获取具有从指定的类型参数派生的协定名称的所有导出。Gets all the exports with the contract name derived from the specified type parameter.
public:
generic <typename T, typename TMetadataView>
System::Collections::Generic::IEnumerable<Lazy<T, TMetadataView> ^> ^ GetExports();
public System.Collections.Generic.IEnumerable<Lazy<T,TMetadataView>> GetExports<T,TMetadataView> ();
member this.GetExports : unit -> seq<Lazy<'T, 'MetadataView>>
Public Function GetExports(Of T, TMetadataView) () As IEnumerable(Of Lazy(Of T, TMetadataView))
类型参数
- T
要返回的 Lazy<T,TMetadata> 对象的类型参数。The type parameter of the Lazy<T,TMetadata> objects to return. 协定名称也派生自此类型参数。The contract name is also derived from this type parameter.
- TMetadataView
要返回的 Lazy<T,TMetadata> 对象的元数据视图的类型。The type of the metadata view of the Lazy<T,TMetadata> objects to return.
返回
- IEnumerable<Lazy<T,TMetadataView>>
如果找到匹配项,则为具有从 T 派生的协定名称的 Lazy<T,TMetadata> 对象;否则为空的 IEnumerable<T> 对象。The Lazy<T,TMetadata> objects with the contract name derived from T, if found; otherwise, an empty IEnumerable<T> object.
例外
CompositionContainer 对象已被释放。The CompositionContainer object has been disposed of.
TMetadataView 不是有效的元数据视图类型。TMetadataView is not a valid metadata view type.
注解
协定名称是对调用方法的结果 GetContractName T 。The contract name is the result of calling the GetContractName method on T.
通过使用 Ordinal 属性执行区分大小写的非语言比较,对协定名称进行比较。The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.
适用于
GetExports<T,TMetadataView>(String)
获取具有指定的协定名称的所有导出。Gets all the exports with the specified contract name.
public:
generic <typename T, typename TMetadataView>
System::Collections::Generic::IEnumerable<Lazy<T, TMetadataView> ^> ^ GetExports(System::String ^ contractName);
public System.Collections.Generic.IEnumerable<Lazy<T,TMetadataView>> GetExports<T,TMetadataView> (string contractName);
public System.Collections.Generic.IEnumerable<Lazy<T,TMetadataView>> GetExports<T,TMetadataView> (string? contractName);
member this.GetExports : string -> seq<Lazy<'T, 'MetadataView>>
Public Function GetExports(Of T, TMetadataView) (contractName As String) As IEnumerable(Of Lazy(Of T, TMetadataView))
类型参数
- T
要返回的 Lazy<T,TMetadata> 对象的类型参数。The type parameter of the Lazy<T,TMetadata> objects to return. 协定名称也派生自此类型参数。The contract name is also derived from this type parameter.
- TMetadataView
要返回的 Lazy<T,TMetadata> 对象的元数据视图的类型。The type of the metadata view of the Lazy<T,TMetadata> objects to return.
参数
- contractName
- String
要返回的 Lazy<T,TMetadata> 对象的协定名称,或者为 null 或空字符串 ("") 以使用默认的协定名称。The contract name of the Lazy<T,TMetadata> objects to return, or null or an empty string ("") to use the default contract name.
返回
- IEnumerable<Lazy<T,TMetadataView>>
如果找到匹配项,则为具有指定的协定名称的 Lazy<T,TMetadata> 对象;否则为空的 IEnumerable<T> 对象。The Lazy<T,TMetadata> objects with the specified contract name if found; otherwise, an empty IEnumerable<T> object.
例外
CompositionContainer 对象已被释放。The CompositionContainer object has been disposed of.
TMetadataView 不是有效的元数据视图类型。TMetadataView is not a valid metadata view type.
注解
默认协定名称是对调用方法的结果 GetContractName T 。The default contract name is the result of calling the GetContractName method on T.
通过使用 Ordinal 属性执行区分大小写的非语言比较,对协定名称进行比较。The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.
适用于
GetExports<T>()
获取具有从指定的类型参数派生的协定名称的所有导出。Gets all the exports with the contract name derived from the specified type parameter.
public:
generic <typename T>
System::Collections::Generic::IEnumerable<Lazy<T> ^> ^ GetExports();
public System.Collections.Generic.IEnumerable<Lazy<T>> GetExports<T> ();
member this.GetExports : unit -> seq<Lazy<'T>>
Public Function GetExports(Of T) () As IEnumerable(Of Lazy(Of T))
类型参数
- T
要返回的 Lazy<T> 对象的类型参数。The type parameter of the Lazy<T> objects to return. 协定名称也派生自此类型参数。The contract name is also derived from this type parameter.
返回
- IEnumerable<Lazy<T>>
如果找到匹配项,则为具有从 T 派生的协定名称的 Lazy<T> 对象;否则为空的 IEnumerable<T> 对象。The Lazy<T> objects with the contract name derived from T, if found; otherwise, an empty IEnumerable<T> object.
例外
CompositionContainer 对象已被释放。The CompositionContainer object has been disposed of.
注解
协定名称是对调用方法的结果 GetContractName T 。The contract name is the result of calling the GetContractName method on T.
通过使用 Ordinal 属性执行区分大小写的非语言比较,对协定名称进行比较。The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.
适用于
GetExports<T>(String)
获取具有指定的协定名称的所有导出。Gets all the exports with the specified contract name.
public:
generic <typename T>
System::Collections::Generic::IEnumerable<Lazy<T> ^> ^ GetExports(System::String ^ contractName);
public System.Collections.Generic.IEnumerable<Lazy<T>> GetExports<T> (string contractName);
public System.Collections.Generic.IEnumerable<Lazy<T>> GetExports<T> (string? contractName);
member this.GetExports : string -> seq<Lazy<'T>>
Public Function GetExports(Of T) (contractName As String) As IEnumerable(Of Lazy(Of T))
类型参数
参数
- contractName
- String
要返回的 Lazy<T> 对象的协定名称,或者为 null 或空字符串 ("") 以使用默认的协定名称。The contract name of the Lazy<T> objects to return, or null or an empty string ("") to use the default contract name.
返回
- IEnumerable<Lazy<T>>
如果找到匹配项,则为具有指定的协定名称的 Lazy<T> 对象;否则为空的 IEnumerable<T> 对象。The Lazy<T> objects with the specified contract name, if found; otherwise, an empty IEnumerable<T> object.
例外
CompositionContainer 对象已被释放。The CompositionContainer object has been disposed of.
注解
默认协定名称是对调用方法的结果 GetContractName T 。The default contract name is the result of calling the GetContractName method on T.
通过使用 Ordinal 属性执行区分大小写的非语言比较,对协定名称进行比较。The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.