System.ComponentModel.Composition 命名空間

這個命名空間所提供的類別會構成 Managed Extensibility Framework (MEF) 的核心。 This namespace provides classes that constitute the core of the Managed Extensibility Framework, or MEF.

類別

AdaptationConstants

包含撰寫系統使用的靜態中繼資料機碼。Contains static metadata keys used by the composition system.

AttributedModelServices

包含 Helper 方法,這些方法會用於具有撰寫功能的 MEF 屬性化程式設計模型。Contains helper methods for using the MEF attributed programming model with composition.

CatalogReflectionContextAttribute

當套用到 Assembly 物件時,啟用 AssemblyCatalog 物件以找到自訂 ReflectionContext 物件。When applied to a Assembly object, enables an AssemblyCatalog object to discover custom ReflectionContext objects.

ChangeRejectedException

例外狀況,指出組件是否已在撰寫期間遭拒。An exception that indicates whether a part has been rejected during composition.

CompositionContractMismatchException

Lazy<T>Lazy<T,TMetadata> 物件的基礎匯出值或中繼資料無法分別轉型為 TTMetadataView 時,擲回的例外狀況。The exception that is thrown when the underlying exported value or metadata of a Lazy<T> or Lazy<T,TMetadata> object cannot be cast to T or TMetadataView, respectively.

CompositionError

表示在複合期間所發生的錯誤。Represents an error that occurred during composition.

CompositionException

表示在 CompositionContainer 物件的複合期間,當一個或多個錯誤發生時所擲回的例外狀況。Represents the exception that is thrown when one or more errors occur during composition in a CompositionContainer object.

ExportAttribute

指定型別、屬性、欄位或方法可提供特定匯出。Specifies that a type, property, field, or method provides a particular export.

ExportFactory<T>

建立組件之新執行個體的 Factory,這個組件會提供指定的匯出。A factory that creates new instances of a part that provides the specified export.

ExportFactory<T,TMetadata>

建立組件之新執行個體的 Factory,這個組件透過附加的中繼資料提供指定的匯出。A factory that creates new instances of a part that provides the specified export, with attached metadata.

ExportLifetimeContext<T>

保留 ExportFactory<T> 物件建立的匯出值及方法的參考,以釋放該物件。Holds an exported value created by an ExportFactory<T> object and a reference to a method to release that object.

ExportMetadataAttribute

針對以 ExportAttribute 標記的型別、屬性、欄位或方法,指定中繼資料。Specifies metadata for a type, property, field, or method marked with the ExportAttribute.

ImportAttribute

指定應該由 CompositionContainer 物件提供屬性、欄位或參數值。Specifies that a property, field, or parameter value should be provided by the CompositionContainer.object.

ImportCardinalityMismatchException

當匯入的基數與相符匯出的基數不相容時,擲回的例外狀況。The exception that is thrown when the cardinality of an import is not compatible with the cardinality of the matching exports.

ImportingConstructorAttribute

指定建立組件時應使用的建構函式。Specifies which constructor should be used when creating a part.

ImportManyAttribute

指定應該由 CompositionContainer 物件在屬性、欄位或參數中填入所有相符的匯出。Specifies that a property, field, or parameter should be populated with all matching exports by the CompositionContainer object.

InheritedExportAttribute

指定某個型別提供特定的匯出,且該型別的子類別也會提供該匯出。Specifies that a type provides a particular export, and that subclasses of that type will also provide that export.

MetadataAttributeAttribute

指定自訂屬性 (Attribute) 的屬性 (Property) 可針對套用至相同類型、屬性 (Property)、欄位或方法的匯出來提供中繼資料。Specifies that a custom attribute's properties provide metadata for exports applied to the same type, property, field, or method.

MetadataViewImplementationAttribute

指定用來實作中繼資料檢視的類型。Specifies the type used to implement a metadata view.

PartCreationPolicyAttribute

指定組件的 CreationPolicySpecifies the CreationPolicy for a part.

PartMetadataAttribute

指定組件的中繼資料。Specifies metadata for a part.

PartNotDiscoverableAttribute

指定 ComposablePartCatalog 將不會包含此類型的匯出。Specifies that this type's exports won't be included in a ComposablePartCatalog.

介面

ICompositionService

提供方法來滿足現有組件執行個體上的匯入。Provides methods to satisfy imports on an existing part instance.

IPartImportsSatisfiedNotification

在已滿足組件的匯入時通知組件。Notifies a part when its imports have been satisfied.

列舉

CreationPolicy

指定執行個體化組件的時機和方式。Specifies when and how a part will be instantiated.

ImportSource

指定值,該值表示 MEF 組合引擎搜尋匯入的方式。Specifies values that indicate how the MEF composition engine searches for imports.