System.Composition 命名空间

包含一些类,这些类用于创建和指定导出属性、检索组合导出、配置导入属性以及指定部件在组合期间的交互方式。 Contains classes for creating and specifying export attributes, retrieving exports from a composition, configuring import attributes, and for specifying how parts interact during composition.

CompositionContext

提供用于从组合中检索导出的方法。Provides methods to retrieve exports from the composition.

CompositionContextExtensions

将方法添加到特定于类型化部件模型的撰写上下文中。Adds methods to the composition context that are specific to the typed parts model.

Export<T>

一个引用,它允许释放与导出实例关联的部件关系图。A reference that allows the graph of parts associated with an exported instance to be released.

ExportAttribute

指定某个类型、属性、字段或方法提供特定的导出。Specifies that a type, property, field, or method provides a particular export.

ExportFactory<T>

工厂创建了提供指定导出部件的新实例。A factory that creates new instances of a part that provides the specified export.

ExportFactory<T,TMetadata>

一个工厂,它创建提供指定导出的部件的新实例,具有附加元数据。A factory that creates new instances of a part that provides the specified export, with attached metadata.

ExportMetadataAttribute

指定带有 ExportAttribute 属性标记的类型、属性、字段或方法的元数据。Specifies metadata for a type, property, field, or method that is marked with the ExportAttribute attribute.

ImportAttribute

指定应由宿主容器提供属性或参数值。Specifies that a property or parameter value should be provided by the host container.

ImportingConstructorAttribute

指定在创建特性化部件时应使用哪个构造函数。Specifies which constructor should be used when creating an attributed part.

ImportManyAttribute

指定属性、字段或参数应通过宿主容器用所有匹配的导出进行填充。Specifies that a property, field, or parameter should be populated with all matching exports by the host container.

ImportMetadataConstraintAttribute

指定需要特定元数据值的导入。Specifies that an import requires certain metadata values.

MetadataAttributeAttribute

指定自定义特性的属性为应用于同一类型、属性、字段或方法的导出提供元数据。Specifies that a custom attribute's properties provide metadata for exports applied to the same type, property, field, or method.

OnImportsSatisfiedAttribute

指定在复合完成时应调用的方法。Specifies that a method should be called when composition is completed.

PartMetadataAttribute

指定部件的元数据。Specifies metadata for a part.

PartNotDiscoverableAttribute

指定此类型的导出不包含在目录中。Specifies that this type's exports won't be included in a catalog.

SharedAttribute

将修饰部件标记为受约束,以在指定的边界内共享。Marks the decorated part as being constrained to sharing within the specified boundary.

SharingBoundaryAttribute

当应用于 ExportFactory<T> 对象的导入时,标记共享范围的边界。When applied to an import of an ExportFactory<T> object, marks the boundary of a sharing scope.