WebPartDescriptionCollection 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
由要与控件目录一起使用的对象WebPartDescription集合WebPart组成。 此类不能被继承。
public ref class WebPartDescriptionCollection sealed : System::Collections::ReadOnlyCollectionBase
public sealed class WebPartDescriptionCollection : System.Collections.ReadOnlyCollectionBase
type WebPartDescriptionCollection = class
inherit ReadOnlyCollectionBase
Public NotInheritable Class WebPartDescriptionCollection
Inherits ReadOnlyCollectionBase
- 继承
注解
该WebPartDescriptionCollection类由方法实现CatalogPart中的各种GetAvailableWebPartDescriptions控件创建。 对于控件中包含的WebPart每个CatalogPart控件,将创建一个WebPartDescription对象。 此对象维护有关 WebPart 控件的基本信息,包括其 ID、标题、说明和关联图标的路径。 各种 CatalogPart 控件可以使用 WebPartDescription 对象在目录中显示 WebPart 控件的信息,而无需创建控件本身的 WebPart 实例。
Web WebPartDescriptionCollection 部件控件集在内部使用该类来维护目录中使用的所有 WebPartDescription 对象的集合。 仅 WebPartDescriptionCollection 当页面处于目录显示模式时,才会使用该集合。 CatalogPart呈现控件时,它会循环访问WebPartDescriptionCollection集合,将每个WebPartDescription对象中的信息添加到显示的目录。
构造函数
| 名称 | 说明 |
|---|---|
| WebPartDescriptionCollection() |
初始化类的 WebPartDescriptionCollection 空新实例。 |
| WebPartDescriptionCollection(ICollection) |
通过传入WebPartDescriptionCollection对象的集合ICollection来初始化对象的新实例WebPartDescription。 |
属性
| 名称 | 说明 |
|---|---|
| Count |
获取实例中包含的 ReadOnlyCollectionBase 元素数。 (继承自 ReadOnlyCollectionBase) |
| InnerList |
获取实例中包含的 ReadOnlyCollectionBase 元素列表。 (继承自 ReadOnlyCollectionBase) |
| Item[Int32] |
根据集合中的索引获取集合的成员。 |
| Item[String] |
基于唯一字符串标识符获取集合的成员。 |
方法
| 名称 | 说明 |
|---|---|
| Contains(WebPartDescription) |
返回一个值,该值指示集合中是否存在特定控件。 |
| CopyTo(WebPartDescription[], Int32) |
将集合复制到对象的数组 WebPartDescription 。 |
| Equals(Object) |
确定指定的对象是否等于当前对象。 (继承自 Object) |
| GetEnumerator() |
返回循环访问实例的 ReadOnlyCollectionBase 枚举数。 (继承自 ReadOnlyCollectionBase) |
| GetHashCode() |
用作默认哈希函数。 (继承自 Object) |
| GetType() |
获取当前实例的 Type。 (继承自 Object) |
| IndexOf(WebPartDescription) |
返回集合的特定成员的位置。 |
| MemberwiseClone() |
创建当前 Object的浅表副本。 (继承自 Object) |
| ToString() |
返回一个表示当前对象的字符串。 (继承自 Object) |
显式接口实现
| 名称 | 说明 |
|---|---|
| ICollection.CopyTo(Array, Int32) |
将整个 ReadOnlyCollectionBase 复制到兼容的一维 Array,从目标数组的指定索引处开始。 (继承自 ReadOnlyCollectionBase) |
| ICollection.IsSynchronized |
获取一个值,该值指示是否同步对 ReadOnlyCollectionBase 对象的访问(线程安全)。 (继承自 ReadOnlyCollectionBase) |
| ICollection.SyncRoot |
获取可用于同步对 ReadOnlyCollectionBase 对象的访问的对象。 (继承自 ReadOnlyCollectionBase) |
扩展方法
| 名称 | 说明 |
|---|---|
| AsParallel(IEnumerable) |
启用查询的并行化。 |
| AsQueryable(IEnumerable) |
将 IEnumerable 转换为 IQueryable。 |
| Cast<TResult>(IEnumerable) |
将 IEnumerable 的元素强制转换为指定类型。 |
| OfType<TResult>(IEnumerable) |
根据指定类型筛选 IEnumerable 的元素。 |