System.Collections.Specialized 命名空间

包含专用的强类型集合;例如,链接列表词典、位向量以及只包含字符串的集合。 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

为关联的 abstract 键和 String 值的集合(可通过键或索引来访问它)提供 Object 基类。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.SpecializedStringCollectionStringDictionary ,两者都包含独占字符串的值。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.