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
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기