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

  • contractName
    Type: System.String
    The contract name to use for the import.
  • requiredTypeIdentity
    Type: System.String
    The required type identity for the import.

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.