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 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應