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

Creates an import definition for the specified parameter, with the specified contract name, type identity, required metadata, cardinality, creation policy, and origin.

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,
	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
A value that indicates the import's creation policy.
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.

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: