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
.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈