System.Collections.Specialized 命名空間

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.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.