Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new OrderedDictionary. The Compare method of the passed comparison object
 /// will be used to compare keys in this dictionary.
 /// </summary>
 /// <remarks>
 /// The GetHashCode and Equals methods of the provided IComparer&lt;TKey&gt; will never
 /// be called, and need not be implemented.</remarks>
 /// <param name="comparer">An instance of IComparer&lt;TKey&gt; that will be used to compare keys.</param>
 public OrderedDictionary(IComparer <TKey> comparer) :
     this(null, comparer, Comparers.ComparerKeyValueFromComparerKey <TKey, TValue>(comparer))
 {
     if (comparer == null)
     {
         throw new ArgumentNullException("comparer");
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// <para>Creates a new OrderedDictionary. The Compare method of the passed comparison object
 /// will be used to compare keys in this dictionary.</para>
 /// <para>A collection and keys and values (typically another dictionary) is used to initialized the
 /// contents of the dictionary.</para>
 /// </summary>
 /// <remarks>
 /// The GetHashCode and Equals methods of the provided IComparer&lt;TKey&gt; will never
 /// be called, and need not be implemented.</remarks>
 /// <param name="keysAndValues">A collection of keys and values whose contents are used to initialized the dictionary.</param>
 /// <param name="comparer">An instance of IComparer&lt;TKey&gt; that will be used to compare keys.</param>
 public OrderedDictionary(IEnumerable <KeyValuePair <TKey, TValue> > keysAndValues, IComparer <TKey> comparer)
     : this(keysAndValues, comparer, Comparers.ComparerKeyValueFromComparerKey <TKey, TValue>(comparer))
 {
     if (comparer == null)
     {
         throw new ArgumentNullException("comparer");
     }
 }