Export (0) Print
Expand All

ExportProvider.GetExports Method (Type, Type, String)

Gets all the exports with the specified contract name.

Namespace:  System.ComponentModel.Composition.Hosting
Assembly:  System.ComponentModel.Composition (in System.ComponentModel.Composition.dll)

public IEnumerable<Lazy<Object, Object>> GetExports(
	Type type,
	Type metadataViewType,
	string contractName
)

Parameters

type
Type: System.Type
The type of the Export objects to return.
metadataViewType
Type: System.Type
The type of the metadata view of the Export objects to return.
contractName
Type: System.String
The contract name of the Export object to return, or null or an empty string ("") to use the default contract name.

Return Value

Type: System.Collections.Generic.IEnumerable<Lazy<Object, Object>>
A collection of all the Export objects for the contract matching contractName.

ExceptionCondition
ObjectDisposedException

The CompositionContainer object has been disposed of.

ArgumentNullException

type is null.

InvalidOperationException

metadataViewType is not a valid metadata view type.

The returned Export objects are instances of Export<T, TMetadataView> underneath, where T is type and TMetadataView is metadataViewType.

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.

Silverlight

Supported in: 5, 4

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft