CompositionScopeDefinition 类

定义

表示有范围类别的树中的节点,反应底层目录及其子范围。Represents a node in a tree of scoped catalogs, reflecting an underlying catalog and its child scopes.

public ref class CompositionScopeDefinition : System::ComponentModel::Composition::Primitives::ComposablePartCatalog, System::ComponentModel::Composition::Hosting::INotifyComposablePartCatalogChanged
public class CompositionScopeDefinition : System.ComponentModel.Composition.Primitives.ComposablePartCatalog, System.ComponentModel.Composition.Hosting.INotifyComposablePartCatalogChanged
type CompositionScopeDefinition = class
    inherit ComposablePartCatalog
    interface INotifyComposablePartCatalogChanged
Public Class CompositionScopeDefinition
Inherits ComposablePartCatalog
Implements INotifyComposablePartCatalogChanged
继承
CompositionScopeDefinition
实现

注解

重要

此类型实现 IDisposable 接口。This type implements the IDisposable interface. 在使用完类型后,您应直接或间接释放类型。When you have finished using the type, you should dispose of it either directly or indirectly. 若要直接释放类型,请在 Disposetry/ 块中调用其 catch 方法。To dispose of the type directly, call its Dispose method in a try/catch block. 若要间接释放类型,请使用 using(在 C# 中)或 Using(在 Visual Basic 中)等语言构造。To dispose of it indirectly, use a language construct such as using (in C#) or Using (in Visual Basic). 有关详细信息,请参阅 IDisposable 接口主题中的“使用实现 IDisposable 的对象”一节。For more information, see the "Using an Object that Implements IDisposable" section in the IDisposable interface topic.

构造函数

CompositionScopeDefinition()

初始化 CompositionScopeDefinition 类的新实例。Initializes a new instance of the CompositionScopeDefinition class.

CompositionScopeDefinition(ComposablePartCatalog, IEnumerable<CompositionScopeDefinition>)

使用指定的基础目录和子项初始化 CompositionScopeDefinition 类的新实例。Initializes a new instance of the CompositionScopeDefinition class with the specified underlying catalog and children.

CompositionScopeDefinition(ComposablePartCatalog, IEnumerable<CompositionScopeDefinition>, IEnumerable<ExportDefinition>)

使用指定的基础目录,子项和公共图面初始化 CompositionScopeDefinition 类的新实例。Initializes a new instance of the CompositionScopeDefinition class with the specified underlying catalog, children, and public surface.

属性

Children

获取此类别的子范围。Gets the child scopes of this catalog.

Parts

获取目录中包含的部件定义。Gets the part definitions that are contained in the catalog.

(继承自 ComposablePartCatalog)
PublicSurface

获取对此目录的上一级范围可见部分的集合。Gets a collection of parts visible to the parent scope of this catalog.

方法

Dispose()

释放 ComposablePartCatalog 使用的所有资源。Releases all resources used by the ComposablePartCatalog.

(继承自 ComposablePartCatalog)
Dispose(Boolean)

Dispose()Finalize() 方法调用,以释放 CompositionScopeDefinition 类的当前实例所占用的托管资源和非托管资源。Called by the Dispose() and Finalize() methods to release the managed and unmanaged resources used by the current instance of the CompositionScopeDefinition class.

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetEnumerator()

返回一个循环访问类别的枚举器。Returns an enumerator that iterates through the catalog.

GetExports(ImportDefinition)

获取与导入定义所指定的条件相匹配的导出的集合。Gets a collection of exports that match the conditions specified by the import definition.

GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
OnChanged(ComposablePartCatalogChangeEventArgs)

引发 Changed 事件。Raises the Changed event.

OnChanging(ComposablePartCatalogChangeEventArgs)

引发 Changing 事件。Raises the Changing event.

ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

事件

Changed

当基础目录已更改时发生(如果目录支持通知)。Occurs when the underlying catalog has changed, if that catalog supports notifications.

Changing

当基础目录正在更改时发生 (如果目录支持通知)。Occurs when the underlying catalog is changing, if that catalog supports notifications.

显式接口实现

IEnumerable.GetEnumerator()

返回一个循环访问类别的枚举器。Returns an enumerator that iterates through the catalog.

(继承自 ComposablePartCatalog)

扩展方法

CreateCompositionService(ComposablePartCatalog)

用作为导出源的指定目录创建新复合服务。Creates a new composition service by using the specified catalog as a source for exports.

Filter(ComposablePartCatalog, Func<ComposablePartDefinition,Boolean>)

用指定的筛选功能筛选指定的目录。Filters the specified catalog with the specified filter function.

CopyToDataTable<T>(IEnumerable<T>)

在给定其泛型参数 DataTableDataRow 的输入 IEnumerable<T> 对象的情况下,返回包含 T 对象副本的 DataRowReturns a DataTable that contains copies of the DataRow objects, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

在给定其泛型参数 DataRowDataTable 的输入 IEnumerable<T> 对象的情况下,将 T 对象复制到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

在给定其泛型参数 DataRowDataTable 的输入 IEnumerable<T> 对象的情况下,将 T 对象复制到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

Ancestors<T>(IEnumerable<T>)

返回元素集合,其中包含源集合中每个节点的上级。Returns a collection of elements that contains the ancestors of every node in the source collection.

Ancestors<T>(IEnumerable<T>, XName)

返回经过筛选的元素集合,其中包含源集合中每个节点的上级。Returns a filtered collection of elements that contains the ancestors of every node in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>)

返回源集合中每个文档和元素的子代节点的集合。Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>)

返回元素集合,其中包含源集合中每个元素和文档的子代元素。Returns a collection of elements that contains the descendant elements of every element and document in the source collection.

Descendants<T>(IEnumerable<T>, XName)

返回经过筛选的元素集合,其中包含源集合中每个元素和文档的子代元素。Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

Elements<T>(IEnumerable<T>)

返回源集合中每个元素和文档的子元素的集合。Returns a collection of the child elements of every element and document in the source collection.

Elements<T>(IEnumerable<T>, XName)

返回源集合中经过筛选的每个元素和文档的子元素集合。Returns a filtered collection of the child elements of every element and document in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

InDocumentOrder<T>(IEnumerable<T>)

返回节点集合(其中包含源集合中的所有节点),并按文档顺序排列。Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

Nodes<T>(IEnumerable<T>)

返回源集合中每个文档和元素的子节点集合。Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>)

将源集合中的每个节点从其父节点中移除。Removes every node in the source collection from its parent node.

适用于