Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new OrderedDictionary. The passed delegate will be used to compare keys in this dictionary.
 /// </summary>
 /// <param name="comparison">A delegate to a method that will be used to compare keys.</param>
 public OrderedDictionary(Comparison <TKey> comparison) :
     this(null, Comparers.ComparerFromComparison <TKey>(comparison), Comparers.ComparerKeyValueFromComparisonKey <TKey, TValue>(comparison))
 {
 }
Ejemplo n.º 2
0
 /// <summary>
 /// <para>Creates a new OrderedDictionary. The passed delegate 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>
 /// <param name="keysAndValues">A collection of keys and values whose contents are used to initialized the dictionary.</param>
 /// <param name="comparison">A delegate to a method that will be used to compare keys.</param>
 public OrderedDictionary(IEnumerable <KeyValuePair <TKey, TValue> > keysAndValues, Comparison <TKey> comparison)
     : this(keysAndValues, Comparers.ComparerFromComparison <TKey>(comparison), Comparers.ComparerKeyValueFromComparisonKey <TKey, TValue>(comparison))
 {
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a new OrderedDictionary. The TKey must implemented IComparable&lt;TKey&gt;
 /// or IComparable.
 /// The CompareTo method of this interface will be used to compare keys in this dictionary.
 /// </summary>
 /// <exception cref="InvalidOperationException">TKey does not implement IComparable&lt;TKey&gt;.</exception>
 public OrderedDictionary() :
     this(Comparers.DefaultComparer <TKey>())
 {
 }
Ejemplo n.º 4
0
 /// <summary>
 /// <para>Creates a new OrderedDictionary. The TKey must implemented IComparable&lt;TKey&gt;
 /// or IComparable.
 /// The CompareTo method of this interface 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>
 /// <param name="keysAndValues">A collection of keys and values whose contents are used to initialized the dictionary.</param>
 /// <exception cref="InvalidOperationException">TKey does not implement IComparable&lt;TKey&gt;.</exception>
 public OrderedDictionary(IEnumerable <KeyValuePair <TKey, TValue> > keysAndValues)
     : this(keysAndValues, Comparers.DefaultComparer <TKey>())
 {
 }