ComposablePart.SetImport(ImportDefinition, IEnumerable<Export>) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
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.
SetImport(ImportDefinition, IEnumerable<Export>) has been previously called and IsRecomposable is false
.