Constructors
- Dictionary`2() Initializes a new instance of the Dictionary`2 class that is empty, has the default initial capacity, and uses the default equality comparer for the key type.
-
Dictionary`2(IDictionary<`0,
`1>) Initializes a new instance of the Dictionary`2 class that contains elements copied from the specified IDictionary`2 and uses the default equality comparer for the key type. -
Dictionary`2(IDictionary<`0,
`1>, Initializes a new instance of the Dictionary`2 class that contains elements copied from the specified IDictionary`2 and uses the specified IEqualityComparer`1.IEquality Comparer<`0>) -
Dictionary`2(IEnumerable<Key
Value Pair<`0, `1>>) -
Dictionary`2(IEnumerable<Key
Value Pair<`0, `1>>, IEquality Comparer<`0>) -
Dictionary`2(IEquality
Comparer<`0>) Initializes a new instance of the Dictionary`2 class that is empty, has the default initial capacity, and uses the specified IEqualityComparer`1. - Dictionary`2(Int32) Initializes a new instance of the Dictionary`2 class that is empty, has the specified initial capacity, and uses the default equality comparer for the key type.
-
Dictionary`2(Int32,
IEquality Initializes a new instance of the Dictionary`2 class that is empty, has the specified initial capacity, and uses the specified IEqualityComparer`1.Comparer<`0>) -
Dictionary`2(Serialization
Info, protected Initializes a new instance of the Dictionary`2 class with serialized data.Streaming Context)
Methods
-
Add(`0,
`1) sealed Adds the specified key and value to the dictionary. - Clear() sealed Removes all keys and values from the Dictionary`2.
-
Contains
Key(`0) sealed Determines whether the Dictionary`2 contains the specified key. -
Contains
Value(`1) Determines whether the Dictionary`2 contains a specific value. -
Ensure
Capacity(Int32) Ensures that the dictionary can hold up to a specified number of entries without any further expansion of its backing storage. -
Get
Enumerator() Returns an enumerator that iterates through the Dictionary`2. -
Get
Object virtual Implements the ISerializable interface and returns the data needed to serialize the Dictionary`2 instance.Data(Serialization Info, Streaming Context) -
On
Deserialization(Object) virtual Implements the ISerializable interface and raises the deserialization event when the deserialization is complete. - Remove(`0) sealed Removes the value with the specified key from the Dictionary`2.
-
Remove(`0,
`1&) -
Trim
Excess() Sets the capacity of this dictionary to what it would be if it had been originally initialized with all its entries. -
Trim
Excess(Int32) Sets the capacity of this dictionary to hold up a specified number of entries without any further expansion of its backing storage. -
Try
Add(`0, Attempts to add the specified key and value to the dictionary.`1) -
Try
Get sealed Gets the value associated with the specified key.Value(`0, `1&)
Properties
- Comparer Gets the IEqualityComparer`1 that is used to determine equality of keys for the dictionary.
- Count sealed Gets the number of key/value pairs contained in the Dictionary`2.
- Item sealed
- Keys Gets a collection containing the keys in the Dictionary`2.
-
System.
Collections. privatesealedGeneric. ICollection<System. Collections. Generic. Key Value Pair<TKey, TValue>>. Is Read Only -
System.
Collections. privatesealedGeneric. IDictionary<TKey, TValue>. Keys -
System.
Collections. privatesealedGeneric. IDictionary<TKey, TValue>. Values -
System.
Collections. privatesealedGeneric. IRead Only Dictionary<TKey, TValue>. Keys -
System.
Collections. privatesealedGeneric. IRead Only Dictionary<TKey, TValue>. Values -
System.
Collections. privatesealed Gets a value that indicates whether access to the ICollection is synchronized (thread safe).ICollection. Is Synchronized -
System.
Collections. privatesealed Gets an object that can be used to synchronize access to the ICollection.ICollection. Sync Root -
System.
Collections. privatesealed Gets a value that indicates whether the IDictionary has a fixed size.IDictionary. Is Fixed Size -
System.
Collections. privatesealed Gets a value that indicates whether the IDictionary is read-only.IDictionary. Is Read Only -
System.
Collections. privatesealedIDictionary. Item -
System.
Collections. privatesealed Gets an ICollection containing the keys of the IDictionary.IDictionary. Keys -
System.
Collections. privatesealed Gets an ICollection containing the values in the IDictionary.IDictionary. Values - Values Gets a collection containing the values in the Dictionary`2.