Class ValueDictionary<TKey, TValue>
- Namespace
- GuildWars2.Collections
- Assembly
- GW2SDK.dll
Represents a dictionary collection with value semantics, meaning two ValueDictionary<TKey, TValue> instances are considered equal if their contents are equal. Value equality is determined by the keys and values in the dictionary, not by reference.
public sealed class ValueDictionary<TKey, TValue> : Dictionary<TKey, TValue>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable, IDeserializationCallback, ISerializable, IEquatable<ValueDictionary<TKey, TValue>> where TKey : notnull
Type Parameters
TKey
TValue
- Inheritance
-
Dictionary<TKey, TValue>ValueDictionary<TKey, TValue>
- Implements
-
IDictionary<TKey, TValue>ICollection<KeyValuePair<TKey, TValue>>IReadOnlyDictionary<TKey, TValue>IReadOnlyCollection<KeyValuePair<TKey, TValue>>IEnumerable<KeyValuePair<TKey, TValue>>IEquatable<ValueDictionary<TKey, TValue>>
- Inherited Members
Remarks
Adding items to the dictionary changes its hash code. Do not use this type in dictionaries or hash sets.
Constructors
- ValueDictionary()
Initializes a new instance of the ValueDictionary<TKey, TValue> class that is empty.
- ValueDictionary(IDictionary<TKey, TValue>)
Initializes a new instance of the ValueDictionary<TKey, TValue> class that contains elements copied from the specified dictionary.
- ValueDictionary(IDictionary<TKey, TValue>, IEqualityComparer<TKey>?)
Initializes a new instance of the ValueDictionary<TKey, TValue> class that contains elements copied from the specified dictionary and uses the specified comparer.
- ValueDictionary(IEnumerable<KeyValuePair<TKey, TValue>>)
Initializes a new instance of the ValueDictionary<TKey, TValue> class that contains elements copied from the specified collection.
- ValueDictionary(IEnumerable<KeyValuePair<TKey, TValue>>, IEqualityComparer<TKey>?)
Initializes a new instance of the ValueDictionary<TKey, TValue> class that contains elements copied from the specified collection and uses the specified comparer.
- ValueDictionary(IEqualityComparer<TKey>?)
Initializes a new instance of the ValueDictionary<TKey, TValue> class that is empty and uses the specified comparer.
- ValueDictionary(int)
Initializes a new instance of the ValueDictionary<TKey, TValue> class that is empty and has the specified initial capacity.
- ValueDictionary(int, IEqualityComparer<TKey>?)
Initializes a new instance of the ValueDictionary<TKey, TValue> class that is empty, has the specified initial capacity, and uses the specified comparer.
Methods
- Equals(ValueDictionary<TKey, TValue>?)
Determines whether the current ValueDictionary<TKey, TValue> is equal to another ValueDictionary<TKey, TValue> based on value semantics.
- GetHashCode()
Returns a hash code based on the keys and values in the dictionary.
Operators
- operator ==(ValueDictionary<TKey, TValue>?, ValueDictionary<TKey, TValue>?)
Determines whether two ValueDictionary<TKey, TValue> instances are equal by value.
- operator !=(ValueDictionary<TKey, TValue>?, ValueDictionary<TKey, TValue>?)
Determines whether two ValueDictionary<TKey, TValue> instances are not equal by value.