Export (0) Print
Expand All

ReflectionModelServices.CreateImportDefinition Method (Lazy<ParameterInfo>, String, String, IEnumerable<KeyValuePair<String, Type>>, ImportCardinality, CreationPolicy, IDictionary<String, Object>, Boolean, ICompositionElement)

.NET Framework 4.5

Creates an import definition for the specified parameter by using the specified contract name, type identity, import and contract metadata, cardinality, and creation policy.

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

public static ContractBasedImportDefinition CreateImportDefinition(
	Lazy<ParameterInfo> parameter,
	string contractName,
	string requiredTypeIdentity,
	IEnumerable<KeyValuePair<string, Type>> requiredMetadata,
	ImportCardinality cardinality,
	CreationPolicy requiredCreationPolicy,
	IDictionary<string, Object> metadata,
	bool isExportFactory,
	ICompositionElement origin
)

Parameters

parameter
Type: System.Lazy<ParameterInfo>

The parameter to import.

contractName
Type: System.String

The contract name to use for the import.

requiredTypeIdentity
Type: System.String

The required type identity for the import.

requiredMetadata
Type: System.Collections.Generic.IEnumerable<KeyValuePair<String, Type>>

The required metadata for the import.

cardinality
Type: System.ComponentModel.Composition.Primitives.ImportCardinality

The cardinality of the import.

requiredCreationPolicy
Type: System.ComponentModel.Composition.CreationPolicy

One of the enumeration values that specifies the import's creation policy.

metadata
Type: System.Collections.Generic.IDictionary<String, Object>

The contract metadata

isExportFactory
Type: System.Boolean

true to indicate that the import represents an ExportFactory<T>; otherwise, false.

origin
Type: System.ComponentModel.Composition.Primitives.ICompositionElement

The object to import into.

Return Value

Type: System.ComponentModel.Composition.Primitives.ContractBasedImportDefinition
An import definition created from the specified parameters.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft