ReflectionModelServices.CreateImportDefinition Method (Lazy<ParameterInfo>, String, String, IEnumerable<KeyValuePair<String, Type>>, ImportCardinality, CreationPolicy, ICompositionElement)
Microsoft Silverlight will reach end of support after October 2021. Learn more.
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)
Syntax
'Declaration
Public Shared Function CreateImportDefinition ( _
parameter As Lazy(Of ParameterInfo), _
contractName As String, _
requiredTypeIdentity As String, _
requiredMetadata As IEnumerable(Of KeyValuePair(Of String, Type)), _
cardinality As ImportCardinality, _
requiredCreationPolicy As CreationPolicy, _
origin As ICompositionElement _
) As ContractBasedImportDefinition
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.
Version Information
Silverlight
Supported in: 5, 4
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.