CollectionBase 成员
为强类型集合提供 abstract 基类。
下表列出了由 CollectionBase 类型公开的成员。
受保护的构造函数
名称 | 说明 | |
---|---|---|
CollectionBase | 已重载。初始化 CollectionBase 类的新实例。 |
页首
公共属性
(请参见 受保护的属性 )
名称 | 说明 | |
---|---|---|
Capacity | 获取或设置 CollectionBase 可包含的元素数。 | |
Count | 获取包含在 CollectionBase 实例中的元素数。不能重写此属性。 |
页首
受保护的属性
名称 | 说明 | |
---|---|---|
InnerList | 获取一个 ArrayList,它包含 CollectionBase 实例中元素的列表。 | |
List | 获取一个 IList,它包含 CollectionBase 实例中元素的列表。 |
页首
公共方法
(请参见 受保护的方法 )
名称 | 说明 | |
---|---|---|
Clear | 从 CollectionBase 实例移除所有对象。不能重写此方法。 | |
Equals | 已重载。 确定两个 Object 实例是否相等。 (从 Object 继承。) | |
GetEnumerator | 返回循环访问 CollectionBase 实例的枚举数。 | |
GetHashCode | 用作特定类型的哈希函数。GetHashCode 适合在哈希算法和数据结构(如哈希表)中使用。 (从 Object 继承。) | |
GetType | 获取当前实例的 Type。 (从 Object 继承。) | |
ReferenceEquals | 确定指定的 Object 实例是否是相同的实例。 (从 Object 继承。) | |
RemoveAt | 移除 CollectionBase 实例的指定索引处的元素。此方法不可重写。 | |
ToString | 返回表示当前 Object 的 String。 (从 Object 继承。) |
页首
受保护的方法
名称 | 说明 | |
---|---|---|
Finalize | 允许 Object 在“垃圾回收”回收 Object 之前尝试释放资源并执行其他清理操作。 (从 Object 继承。) | |
MemberwiseClone | 创建当前 Object 的浅表副本。 (从 Object 继承。) | |
OnClear | 当清除 CollectionBase 实例的内容时执行其他自定义进程。 | |
OnClearComplete | 在清除 CollectionBase 实例的内容之后执行其他自定义进程。 | |
OnInsert | 在向 CollectionBase 实例中插入新元素之前执行其他自定义进程。 | |
OnInsertComplete | 在向 CollectionBase 实例中插入新元素之后执行其他自定义进程。 | |
OnRemove | 当从 CollectionBase 实例移除元素时执行其他自定义进程。 | |
OnRemoveComplete | 在从 CollectionBase 实例中移除元素之后执行其他自定义进程。 | |
OnSet | 当在 CollectionBase 实例中设置值之前执行其他自定义进程。 | |
OnSetComplete | 当在 CollectionBase 实例中设置值后执行其他自定义进程。 | |
OnValidate | 当验证值时执行其他自定义进程。 |
页首
显式接口实现
名称 | 说明 | |
---|---|---|
System.Collections.ICollection.CopyTo | 从目标数组的指定索引处开始将整个 CollectionBase 复制到兼容的一维 Array。 | |
System.Collections.IList.Add | 将对象添加到 CollectionBase 的结尾处。 | |
System.Collections.IList.Contains | 确定 CollectionBase 是否包含特定元素。 | |
System.Collections.IList.IndexOf | 搜索指定的 Object,并返回整个 CollectionBase 中第一个匹配项的从零开始的索引。 | |
System.Collections.IList.Insert | 将元素插入 CollectionBase 的指定索引处。 | |
System.Collections.IList.Remove | 从 CollectionBase 中移除特定对象的第一个匹配项。 | |
System.Collections.ICollection.IsSynchronized | 获取一个值,该值指示是否同步对 CollectionBase 的访问(线程安全)。 | |
System.Collections.ICollection.SyncRoot | 获取可用于同步 CollectionBase 访问的对象。 | |
System.Collections.IList.IsFixedSize | 获取一个值,该值指示 CollectionBase 是否具有固定大小。 | |
System.Collections.IList.IsReadOnly | 获取一个值,该值指示 CollectionBase 是否为只读。 | |
System.Collections.IList.Item | 获取或设置指定索引处的元素。 |
页首
请参见
参考
CollectionBase 类
System.Collections 命名空间
ArrayList 类
System.Collections.IList
ReadOnlyCollectionBase
System.Collections.Generic