ExportProvider.GetExports Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets all the exports matching the specified conditions.
Overloads
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)
- Source:
- ExportProvider.cs
- Source:
- ExportProvider.cs
- Source:
- ExportProvider.cs
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)
Parameters
- definition
- ImportDefinition
The object that defines the conditions of the Export objects to get.
Returns
A collection of all the Export objects matching the condition specified by definition
.
Exceptions
Cardinality is ExactlyOne and there are zero Export objects that match the conditions of the specified ImportDefinition.
-or-
Cardinality is ZeroOrOne or ExactlyOne and there is more than one Export object that matches the conditions of the specified ImportDefinition.
definition
is null
.
Applies to
GetExports(ImportDefinition, AtomicComposition)
- Source:
- ExportProvider.cs
- Source:
- ExportProvider.cs
- Source:
- ExportProvider.cs
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)
Parameters
- definition
- ImportDefinition
The object that defines the conditions of the Export objects to get.
- atomicComposition
- AtomicComposition
The transactional container for the composition.
Returns
A collection of all the Export objects matching the condition specified by definition
and atomicComposition
.
Exceptions
Cardinality is ExactlyOne and there are zero Export objects that match the conditions of the specified ImportDefinition.
-or-
Cardinality is ZeroOrOne or ExactlyOne and there is more than one Export object that matches the conditions of the specified ImportDefinition.
Applies to
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))
Parameters
- type
- Type
The type parameter of the Lazy<T,TMetadata> objects to return.
- metadataViewType
- Type
The type of the metadata view of the Lazy<T,TMetadata> objects to return.
- contractName
- String
The contract name of the Lazy<T,TMetadata> object to return, or null
or an empty string ("") to use the default contract name.
Returns
A collection of all the Lazy<T,TMetadata> objects for the contract matching contractName
.
Exceptions
The CompositionContainer object has been disposed of.
type
is null
.
metadataViewType
is not a valid metadata view type.
Remarks
The default contract name is the result of calling the GetContractName method on type
.
The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.
Applies to
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))
Type Parameters
- T
The type parameter of the Lazy<T,TMetadata> objects to return. The contract name is also derived from this type parameter.
- TMetadataView
The type of the metadata view of the Lazy<T,TMetadata> objects to return.
Returns
The Lazy<T,TMetadata> objects with the contract name derived from T
, if found; otherwise, an empty IEnumerable<T> object.
Exceptions
The CompositionContainer object has been disposed of.
TMetadataView
is not a valid metadata view type.
Remarks
The contract name is the result of calling the GetContractName method on T
.
The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.
Applies to
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))
Type Parameters
- T
The type parameter of the Lazy<T,TMetadata> objects to return. The contract name is also derived from this type parameter.
- TMetadataView
The type of the metadata view of the Lazy<T,TMetadata> objects to return.
Parameters
- contractName
- String
The contract name of the Lazy<T,TMetadata> objects to return, or null
or an empty string ("") to use the default contract name.
Returns
The Lazy<T,TMetadata> objects with the specified contract name if found; otherwise, an empty IEnumerable<T> object.
Exceptions
The CompositionContainer object has been disposed of.
TMetadataView
is not a valid metadata view type.
Remarks
The default contract name is the result of calling the GetContractName method on T
.
The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.
Applies to
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))
Type Parameters
- T
The type parameter of the Lazy<T> objects to return. The contract name is also derived from this type parameter.
Returns
The Lazy<T> objects with the contract name derived from T
, if found; otherwise, an empty IEnumerable<T> object.
Exceptions
The CompositionContainer object has been disposed of.
Remarks
The contract name is the result of calling the GetContractName method on T
.
The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.
Applies to
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))
Type Parameters
- T
The type parameter of the Lazy<T> objects to return.
Parameters
- contractName
- String
The contract name of the Lazy<T> objects to return, or null
or an empty string ("") to use the default contract name.
Returns
The Lazy<T> objects with the specified contract name, if found; otherwise, an empty IEnumerable<T> object.
Exceptions
The CompositionContainer object has been disposed of.
Remarks
The default contract name is the result of calling the GetContractName method on T
.
The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.