Compartir a través de


ContractBasedImportDefinition Class

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Represents an import that is required by a ComposablePart object and that can specify both a contract name and metadata.

Inheritance Hierarchy

System.Object
  System.ComponentModel.Composition.Primitives.ImportDefinition
    System.ComponentModel.Composition.Primitives.ContractBasedImportDefinition

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

Syntax

'Declaration
Public Class ContractBasedImportDefinition _
    Inherits ImportDefinition
public class ContractBasedImportDefinition : ImportDefinition

The ContractBasedImportDefinition type exposes the following members.

Constructors

  Name Description
Protected method ContractBasedImportDefinition() Initializes a new instance of the ContractBasedImportDefinition class.
Public method ContractBasedImportDefinition(String, String, IEnumerable<KeyValuePair<String, Type>>, ImportCardinality, Boolean, Boolean, CreationPolicy) Initializes a new instance of the ContractBasedImportDefinition class with the specified contract name, required type identity, required metadata, cardinality, a value that indicates if the import definition is recomposable, a value that indicates if the import definition is a prerequisite, and a value that indicates the required creation policy.

Top

Properties

  Name Description
Public property Cardinality Gets the cardinality of the exports required by the import definition. (Inherited from ImportDefinition.)
Public property Constraint Gets an expression that defines conditions that must be matched to satisfy the import described by this import definition. (Overrides ImportDefinition.Constraint.)
Public property ContractName Gets the name of the contract. (Inherited from ImportDefinition.)
Public property IsPrerequisite Gets a value that indicates whether the import definition must be satisfied before a part can start producing exported objects. (Inherited from ImportDefinition.)
Public property IsRecomposable Gets a value that indicates whether the import definition can be satisfied multiple times. (Inherited from ImportDefinition.)
Public property RequiredCreationPolicy Gets or sets a value that indicates that the importer requires a specific CreationPolicy for the exports used to satisfy this import.
Public property RequiredMetadata Gets the metadata names of the export required by the import definition.
Public property RequiredTypeIdentity Gets the expected type of the export that matches this ContractBasedImportDefinition.

Top

Methods

  Name Description
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method IsConstraintSatisfiedBy Returns a value indicating whether the constraint represented by this object is satisfied by the export represented by the given export definition. (Overrides ImportDefinition.IsConstraintSatisfiedBy(ExportDefinition).)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string representation of the import definition. (Inherited from ImportDefinition.)

Top

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.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.