ExportProvider.GetExports 方法   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取与指定条件匹配的所有导出。
重载
| GetExports(ImportDefinition) | 获取与指定导入定义的条件匹配的所有导出。 | 
| GetExports(ImportDefinition, AtomicComposition) | 获取与指定导入定义和组合的条件匹配的所有导出。 | 
| GetExports(Type, Type, String) | 获取具有指定协定名称的所有导出。 | 
| GetExports<T,TMetadataView>() | 获取具有派生自指定类型参数的协定名称的所有导出。 | 
| GetExports<T,TMetadataView>(String) | 获取具有指定协定名称的所有导出。 | 
| GetExports<T>() | 获取具有派生自指定类型参数的协定名称的所有导出。 | 
| GetExports<T>(String) | 获取具有指定协定名称的所有导出。 | 
GetExports(ImportDefinition)
- Source:
- ExportProvider.cs
- Source:
- ExportProvider.cs
- Source:
- ExportProvider.cs
- Source:
- ExportProvider.cs
获取与指定导入定义的条件匹配的所有导出。
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 对象的条件的对象。
返回
与 definition指定的条件匹配的所有 Export 对象的集合。
例外
Cardinality 是 ExactlyOne,并且有零个与指定 ImportDefinition条件匹配的 Export 对象。
-或-
Cardinality 是 ZeroOrOne 或 ExactlyOne,并且有多个 Export 对象与指定 ImportDefinition的条件匹配。
              definition
              null。
适用于
GetExports(ImportDefinition, AtomicComposition)
- Source:
- ExportProvider.cs
- Source:
- ExportProvider.cs
- Source:
- ExportProvider.cs
- Source:
- ExportProvider.cs
获取与指定导入定义和组合的条件匹配的所有导出。
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 对象的条件的对象。
- atomicComposition
- AtomicComposition
构成的事务容器。
返回
与 definition 和 atomicComposition指定的条件匹配的所有 Export 对象的集合。
例外
Cardinality 是 ExactlyOne,并且有零个与指定 ImportDefinition条件匹配的 Export 对象。
-或-
Cardinality 是 ZeroOrOne 或 ExactlyOne,并且有多个 Export 对象与指定 ImportDefinition的条件匹配。
适用于
GetExports(Type, Type, String)
获取具有指定协定名称的所有导出。
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> 对象的 type 参数。
- metadataViewType
- Type
要返回的 Lazy<T,TMetadata> 对象的元数据视图的类型。
- contractName
- String
要返回的 Lazy<T,TMetadata> 对象的协定名称,或 null 或空字符串(“”)使用默认协定名称。
返回
协定匹配 contractName的所有 Lazy<T,TMetadata> 对象的集合。
例外
              type
              null。
              metadataViewType 不是有效的元数据视图类型。
注解
默认协定名称是在 type上调用 GetContractName 方法的结果。
通过使用 Ordinal 属性执行区分大小写的非语言比较来比较协定名称。
适用于
GetExports<T,TMetadataView>()
获取具有派生自指定类型参数的协定名称的所有导出。
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> 对象的 type 参数。 协定名称也派生自此类型参数。
- TMetadataView
要返回的 Lazy<T,TMetadata> 对象的元数据视图的类型。
返回
如果找到,则 Lazy<T,TMetadata> 具有派生自 T的协定名称的对象;否则为空 IEnumerable<T> 对象。
例外
              TMetadataView 不是有效的元数据视图类型。
注解
协定名称是在 T上调用 GetContractName 方法的结果。
通过使用 Ordinal 属性执行区分大小写的非语言比较来比较协定名称。
适用于
GetExports<T,TMetadataView>(String)
获取具有指定协定名称的所有导出。
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> 对象的 type 参数。 协定名称也派生自此类型参数。
- TMetadataView
要返回的 Lazy<T,TMetadata> 对象的元数据视图的类型。
参数
- contractName
- String
要返回的 Lazy<T,TMetadata> 对象的协定名称,或 null 或空字符串(“”)使用默认协定名称。
返回
找到具有指定协定名称的 Lazy<T,TMetadata> 对象;否则为空 IEnumerable<T> 对象。
例外
              TMetadataView 不是有效的元数据视图类型。
注解
默认协定名称是在 T上调用 GetContractName 方法的结果。
通过使用 Ordinal 属性执行区分大小写的非语言比较来比较协定名称。
适用于
GetExports<T>()
获取具有派生自指定类型参数的协定名称的所有导出。
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> 对象的 type 参数。 协定名称也派生自此类型参数。
返回
如果找到,则 Lazy<T> 具有派生自 T的协定名称的对象;否则为空 IEnumerable<T> 对象。
例外
注解
协定名称是在 T上调用 GetContractName 方法的结果。
通过使用 Ordinal 属性执行区分大小写的非语言比较来比较协定名称。
适用于
GetExports<T>(String)
获取具有指定协定名称的所有导出。
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))类型参数
- T
要返回 Lazy<T> 对象的 type 参数。
参数
返回
Lazy<T> 具有指定协定名称的对象(如果找到);否则为空 IEnumerable<T> 对象。
例外
注解
默认协定名称是在 T上调用 GetContractName 方法的结果。
通过使用 Ordinal 属性执行区分大小写的非语言比较来比较协定名称。