TypeCatalog 类

定义

发现类型集合中标有属性的部分。Discovers attributed parts from a collection of types.

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

注解

重要

此类型实现 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.

此类是线程安全的。This class is thread safe.

构造函数

TypeCatalog(IEnumerable<Type>)

使用指定的类型初始化 TypeCatalog 类的新实例。Initializes a new instance of the TypeCatalog class with the specified types.

TypeCatalog(IEnumerable<Type>, ICompositionElement)

使用指定的类型和源部分初始化 TypeCatalog 类的新实例。Initializes a new instance of the TypeCatalog class with the specified types and source for parts.

TypeCatalog(IEnumerable<Type>, ReflectionContext)

通过使用指定相对反射上下文使用特定类型初始化 TypeCatalog 类的新实例。Initializes a new instance of the TypeCatalog class with the specified types in the specified reflection context.

TypeCatalog(IEnumerable<Type>, ReflectionContext, ICompositionElement)

通过部分使用指定相对反射上下文和源使用特定类型初始化 TypeCatalog 类的新实例。Initializes a new instance of the TypeCatalog class with the specified types in the specified reflection context and source for parts.

TypeCatalog(Type[])

使用指定的类型初始化 TypeCatalog 类的新实例。Initializes a new instance of the TypeCatalog class with the specified types.

属性

Parts

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

方法

Dispose()

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

(继承自 ComposablePartCatalog)
Dispose(Boolean)

释放 TypeCatalog 使用的非托管资源,并选择性地释放托管资源。Releases the unmanaged resources used by the TypeCatalog and optionally releases the managed resources.

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)
ToString()

返回类型目录的字符串表示形式。Returns a string representation of the type catalog.

显式接口实现

ICompositionElement.DisplayName

获取类型目录的显示名称。Gets the display name of the type catalog.

ICompositionElement.Origin

获取类型目录源自于的组合元素。Gets the composition element from which the type catalog originated.

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.

适用于