Udostępnij za pośrednictwem


ImportDefinition Class

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

Represents an import that is required by a ComposablePart object.

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 ImportDefinition
public class ImportDefinition

The ImportDefinition type exposes the following members.

Constructors

  Name Description
Protected method ImportDefinition() Initializes a new instance of the ImportDefinition class.
Public method ImportDefinition(Expression<Func<ExportDefinition, Boolean>>, String, ImportCardinality, Boolean, Boolean) Initializes a new instance of the ImportDefinition class with the specified constraint, contract name, cardinality, a value that indicates whether the import definition is recomposable, and a value that indicates whether the import definition is a prerequisite.

Top

Properties

  Name Description
Public property Cardinality Gets the cardinality of the exports required by the import definition.
Public property Constraint Gets an expression that defines conditions that the import must satisfy to match the import definition.
Public property ContractName Gets the name of the contract.
Public property IsPrerequisite Gets a value that indicates whether the import definition must be satisfied before a part can start producing exported objects.
Public property IsRecomposable Gets a value that indicates whether the import definition can be satisfied multiple times.

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 Gets a value that indicates whether the export represented by the specified definition satisfies the constraints of this import definition.
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. (Overrides Object.ToString().)

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.