Επεξεργασία

Κοινή χρήση μέσω


ComposablePart.SetImport(ImportDefinition, IEnumerable<Export>) Method

Definition

Sets the import described by the specified ImportDefinition object to be satisfied by the specified exports.

public:
 abstract void SetImport(System::ComponentModel::Composition::Primitives::ImportDefinition ^ definition, System::Collections::Generic::IEnumerable<System::ComponentModel::Composition::Primitives::Export ^> ^ exports);
public abstract void SetImport (System.ComponentModel.Composition.Primitives.ImportDefinition definition, System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export> exports);
abstract member SetImport : System.ComponentModel.Composition.Primitives.ImportDefinition * seq<System.ComponentModel.Composition.Primitives.Export> -> unit
Public MustOverride Sub SetImport (definition As ImportDefinition, exports As IEnumerable(Of Export))

Parameters

definition
ImportDefinition

One of the objects from the ImportDefinitions property that specifies the import to be set.

exports
IEnumerable<Export>

A collection of Export objects of which to set the import described by definition.

Exceptions

The ComposablePart object has been disposed of.

definition is null.

-or-

exports is null.

An error occurred setting the import described by the ImportDefinition object.

definition did not originate from the ImportDefinitions property on the ComposablePart.

-or-

exports contains an element that is null.

-or-

exports is empty and Cardinality is ExactlyOne.

-or-

exports contains more than one element and Cardinality is ZeroOrOne or ExactlyOne.

Applies to