Initializes a new instance of the Dictionary<(Of <(<'TKey, TValue>)>)> class that contains elements copied from the specified IDictionary<(Of <(<'TKey, TValue>)>)> and uses the specified IEqualityComparer<(Of <(<'T>)>)>.

Namespace: System.Collections.ObjectModel
Assembly: Elysium (in Elysium.dll) Version: 2.0.1042.4 (2.0.1042.4)

Syntax

C#
public ObservableDictionary(
	IDictionary<TKey, TValue> dictionary,
	IEqualityComparer<TKey> comparer
)
Visual Basic
Public Sub New ( 
	dictionary As IDictionary(Of TKey, TValue),
	comparer As IEqualityComparer(Of TKey)
)

Parameters

dictionary
Type: System.Collections.Generic..::..IDictionary<(Of <(<'TKey, TValue>)>)>
The IDictionary<(Of <(<'TKey, TValue>)>)> whose elements are copied to the new Dictionary<(Of <(<'TKey, TValue>)>)>.
comparer
Type: System.Collections.Generic..::..IEqualityComparer<(Of <(<'TKey>)>)>
The IEqualityComparer<(Of <(<'T>)>)> implementation to use when comparing keys, or null to use the default EqualityComparer<(Of <(<'T>)>)> for the type of the key.

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptiondictionary is null.
System..::..ArgumentExceptiondictionary contains one or more duplicate keys.

See Also