System.Collections.Specialized Namespace

System.Collections.Specialized 命名空间包含专用的和强类型的集合,例如,链接的列表词典、位向量以及只包含字符串的集合。 The System.Collections.Specialized namespace contains specialized and strongly-typed collections; for example, a linked list dictionary, a bit vector, and collections that contain only strings.

CollectionChangedEventManager

提供 WeakEventManager 实现,以便可以使用“弱事件侦听器”模式附加 CollectionChanged 事件的侦听器。Provides a WeakEventManager implementation so that you can use the "weak event listener" pattern to attach listeners for the CollectionChanged event.

CollectionsUtil

创建忽略字符串大小写的集合。Creates collections that ignore the case in strings.

HybridDictionary

通过以下方法来实现 IDictionary:在集合较小时使用 ListDictionary,然后在集合变大时切换到 HashtableImplements IDictionary by using a ListDictionary while the collection is small, and then switching to a Hashtable when the collection gets large.

ListDictionary

使用单向链接列表实现 IDictionaryImplements IDictionary using a singly linked list. 对于通常包含少于 10 项的集合,建议使用该实现方法。Recommended for collections that typically include fewer than 10 items.

NameObjectCollectionBase

为关联的 String 键和 Object 值的集合(可通过键或索引来访问它)提供 abstract 基类。Provides the abstract base class for a collection of associated String keys and Object values that can be accessed either with the key or with the index.

NameObjectCollectionBase.KeysCollection

表示集合的 String 键的集合。Represents a collection of the String keys of a collection.

NameValueCollection

表示可通过键或索引访问的关联 String 键和 String 值的集合。Represents a collection of associated String keys and String values that can be accessed either with the key or with the index.

NotifyCollectionChangedEventArgs

CollectionChanged 事件提供数据。Provides data for the CollectionChanged event.

OrderedDictionary

表示键或索引可访问的键/值对的集合。Represents a collection of key/value pairs that are accessible by the key or index.

StringCollection

表示字符串的集合。Represents a collection of strings.

StringDictionary

使用字符串(而不是对象)强类型的键和值来实现哈希表。Implements a hash table with the key and the value strongly typed to be strings rather than objects.

StringEnumerator

支持对 StringCollection 执行简单迭代。Supports a simple iteration over a StringCollection.

结构

BitVector32

提供一个简单结构,该结构以 32 位内存存储布尔值和小整数。Provides a simple structure that stores Boolean values and small integers in 32 bits of memory.

BitVector32.Section

表示可以包含整数的向量的节。Represents a section of the vector that can contain an integer number.

接口

INotifyCollectionChanged

例如,当添加和删除项或清除整个列表时,向侦听器通知动态更改。Notifies listeners of dynamic changes, such as when an item is added and removed or the whole list is cleared.

IOrderedDictionary

表示键/值对的索引集合。Represents an indexed collection of key/value pairs.

枚举

NotifyCollectionChangedAction

描述引起了 CollectionChanged 事件的操作。Describes the action that caused a CollectionChanged event.

委托

NotifyCollectionChangedEventHandler

表示 CollectionChanged 事件的处理方法。Represents the method that handles the CollectionChanged event.

注解

专用的集合是具有专门用途的集合。Specialized collections are collections with highly specific purposes. NameValueCollection 基于NameObjectCollectionBase; 但是,NameValueCollection接受每个密钥,多个值,而NameObjectCollectionBase接受每个密钥只有一个值。NameValueCollection is based on NameObjectCollectionBase; however, NameValueCollection accepts multiple values per key, whereas NameObjectCollectionBase accepts only one value per key.

某些强类型集合中的System.Collections.Specialized命名空间StringCollectionStringDictionary,这两个包含的全都是字符串值。Some strongly typed collections in the System.Collections.Specialized namespace are StringCollection and StringDictionary, both of which contain values that are exclusively strings.

CollectionsUtil类创建的不区分大小写的集合实例。The CollectionsUtil class creates instances of case-insensitive collections.

一些集合转换。Some collections transform. 例如,HybridDictionary类以启动ListDictionary并成为Hashtable变大。For example, the HybridDictionary class starts as a ListDictionary and becomes a Hashtable when it becomes large. KeyedCollection<TKey,TItem>是一个列表,但它的元素数达到指定的阈值时还创建一个查找字典。The KeyedCollection<TKey,TItem> is a list but it also creates a lookup dictionary when the number of elements reaches a specified threshold.