<PackageReference Include="System.Collections" Version="4.0.11-beta-23409" />

SortedDictionary<TKey, TValue>

public class SortedDictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable, IDictionary, ICollection, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>
Represents a collection of key/value pairs that are sorted on the key.
public struct Enumerator<TKey, TValue> : IEnumerator<KeyValuePair<TKey, TValue>>, IDisposable, IEnumerator, IDictionaryEnumerator

Enumerates the elements of a SortedDictionary<T, U>.

public sealed class KeyCollection<TKey, TValue> : ICollection<TKey>, IEnumerable<TKey>, IEnumerable, ICollection, IReadOnlyCollection<TKey>

Represents the collection of keys in a SortedDictionary<T, U>. This class cannot be inherited.

public sealed class ValueCollection<TKey, TValue> : ICollection<TValue>, IEnumerable<TValue>, IEnumerable, ICollection, IReadOnlyCollection<TValue>

Represents the collection of values in a SortedDictionary<T, U>. This class cannot be inherited

public IComparer<TKey> Comparer { get; }

Gets the IComparer<T> used to order the elements of the SortedDictionary<T, U>.

public int Count { get; }

Gets the number of key/value pairs contained in the SortedDictionary<T, U>.

public TValue this[TKey key] { get; set; }

Gets or sets the value associated with the specified key.

public KeyCollection<TKey, TValue> Keys { get; }

Gets a collection containing the keys in the SortedDictionary<T, U>.

public ValueCollection<TKey, TValue> Values { get; }

Gets a collection containing the values in the SortedDictionary<T, U>.

Initializes a new instance of the SortedDictionary<T, U> class that is empty and uses the default IComparer<T> implementation for the key type.

public SortedDictionary(IDictionary<TKey, TValue> dictionary)

Initializes a new instance of the SortedDictionary<T, U> class that contains elements copied from the specified IDictionary<T, U> and uses the default IComparer<T> implementation for the key type.

public SortedDictionary(IDictionary<TKey, TValue> dictionary, IComparer<TKey> comparer)

Initializes a new instance of the SortedDictionary<T, U> class that contains elements copied from the specified IDictionary<T, U> and uses the specified IComparer<T> implementation to compare keys.

public SortedDictionary(IComparer<TKey> comparer)

Initializes a new instance of the SortedDictionary<T, U> class that is empty and uses the specified IComparer<T> implementation to compare keys.

public void Add(TKey key, TValue value)

Adds an element with the specified key and value into the SortedDictionary<T, U>.

public void Clear()

Removes all elements from the SortedDictionary<T, U>.

public bool ContainsKey(TKey key)

Determines whether the SortedDictionary<T, U> contains an element with the specified key.

public bool ContainsValue(TValue value)

Determines whether the SortedDictionary<T, U> contains an element with the specified value.

public void CopyTo(KeyValuePair<TKey, TValue>[] array, int index)

Copies the elements of the SortedDictionary<T, U> to the specified array of KeyValuePair<T, U> structures, starting at the specified index.

public Enumerator<TKey, TValue> GetEnumerator()

Returns an enumerator that iterates through the SortedDictionary<T, U>.

public bool Remove(TKey key)

Removes the element with the specified key from the SortedDictionary<T, U>.

public bool TryGetValue(TKey key, out TValue value)

Gets the value associated with the specified key.