System.Collections.Specialized Namespace

System.Collections.Specialized 命名空間 (Namespace) 包含特定和強型別 (Strongly-Typed) 集合;例如,連結的清單字典、位元向量和只包含字串的集合。 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

若為小型集合,則使用 ListDictionary 實作 IDictionary,在它成為大型集合時,切換為 HashtableImplements IDictionary by using a ListDictionary while the collection is small, and then switching to a Hashtable when the collection gets large.

ListDictionary

使用單向連結串列 (Singly-Linked List) 實作 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

支援簡單反覆處理 StringCollectionSupports a simple iteration over a StringCollection.

結構

BitVector32

提供在 32 位元記憶體中儲存布林值 (Boolean) 和小整數的簡單結構。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.