Class DictionaryEx<TKey, TValue>
A dictionary with support for:
- deep Equals (instead of ref comparison)
- deep GetHashCode (2 refs with the same values will return the same hash code). The default dictionary returns hash code based on reference.
Inheritance
System.Object
DictionaryEx<TKey, TValue>
Implements
System.IEquatable<DictionaryEx<TKey, TValue>>
Namespace: Sdl.Core.Bcm.BcmModel.Collections
Assembly: Sdl.Core.Bcm.BcmModel.dll
Syntax
public class DictionaryEx<TKey, TValue> : Dictionary<TKey, TValue>
Type Parameters
Name | Description |
---|---|
TKey | |
TValue |
Constructors
DictionaryEx()
Initializes a new instance of the DictionaryEx<TKey, TValue> class.
Declaration
public DictionaryEx()
DictionaryEx(DictionaryEx<TKey, TValue>)
Initializes a new instance of the DictionaryEx<TKey, TValue> class, based on another instance.
Declaration
public DictionaryEx(DictionaryEx<TKey, TValue> other)
Parameters
Type | Name | Description |
---|---|---|
DictionaryEx<TKey, TValue> | other | The other instance from which to construct the current instance. |
DictionaryEx(IEnumerable<KeyValuePair<TKey, TValue>>)
Initializes a new instance of the DictionaryEx<TKey, TValue> class.
Declaration
public DictionaryEx(IEnumerable<KeyValuePair<TKey, TValue>> items)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>> | items | The items. |
Methods
Equals(DictionaryEx<TKey, TValue>)
Performs a deep-equals comparison.
System.Object.Equals(object)
Declaration
public bool Equals(DictionaryEx<TKey, TValue> other)
Parameters
Type | Name | Description |
---|---|---|
DictionaryEx<TKey, TValue> | other |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Object)
Performs a deep-equals comparison.
System.Object.Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance. |
Implements
System.IEquatable<>