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 |
---|---|---|
Dictionary |
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. |
items | The items. |
Methods
Equals(DictionaryEx<TKey, TValue>)
Performs a deep-equals comparison.
System.
Declaration
public bool Equals(DictionaryEx<TKey, TValue> other)
Parameters
Type | Name | Description |
---|---|---|
Dictionary |
other |
Returns
Type | Description |
---|---|
System. |
Equals(Object)
Performs a deep-equals comparison.
System.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System. |
obj |
Returns
Type | Description |
---|---|
System. |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System. |
A hash code for this instance. |
Implements
System.IEquatable<>