CollectionBase类

在命名空间System.Collections下的CollectionBase类

The CollectionBase class exposes the interfaces IEnumerable , ICollection , and IList but only

CollectionBase 类有IEnumerable , ICollection , and IList三个接口,
provides some of the required implementation — notably, the Clear() and RemoveAt() methods of

但是只提供了需要的实现,尤其是IList接口的Clear和RemoveAt方法
IList and the Count property of ICollection . You need to implement everything else yourself if you

以及ICollection 接口的Count属性。如果你想要使用提供的功能,就需要自己实现
want the functionality provided.

 

为了便于操作,CollectionBase 提供了2个受保护的属性,List属性以及InnerList属性。

List属性可以通过IList接口访问元素,InnerList则是用于存储元素的ArrayList对象

posted @ 2015-03-03 20:06  ChuckLu  阅读(551)  评论(0编辑  收藏  举报