Class SortedDictionary<TKey, TValue>
Sorted dictionary.
Inheritance
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public class SortedDictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable
Type Parameters
|
TKey
|
|
TValue
|
Constructors
SortedDictionary()
Creates a new sorted dictionary.
Declaration
public SortedDictionary()
SortedDictionary(IComparer<TKey>)
Creates a new sorted dictionary.
Declaration
public SortedDictionary(IComparer<TKey> comparer)
Parameters
|
IComparer<TKey>
comparer
|
SortedDictionary(IDictionary<TKey, TValue>)
Creates a new sorted dictionary.
Declaration
public SortedDictionary(IDictionary<TKey, TValue> dic)
Parameters
|
IDictionary<TKey, TValue>
dic
|
SortedDictionary(IDictionary<TKey, TValue>, IComparer<TKey>)
Creates a new sorted dictionary.
Declaration
public SortedDictionary(IDictionary<TKey, TValue> dic, IComparer<TKey> comparer)
Parameters
|
IDictionary<TKey, TValue>
dic
|
|
IComparer<TKey>
comparer
|
Properties
Comparer
Gets the current comparer.
Declaration
public IComparer<TKey> Comparer { get; }
Property Value
|
IComparer<TKey>
|
Count
Returns the count.
Declaration
public int Count { get; }
Property Value
|
System.Int32
|
Item[TKey]
Returns the value associated with the given key.
Declaration
public TValue this[TKey key] { get; set; }
Parameters
|
TKey
key
|
Property Value
|
TValue
|
Keys
Returns the key collection.
Declaration
public SortedDictionary<TKey, TValue>.KeyCollection Keys { get; }
Property Value
|
SortedDictionary.KeyCollection<>
|
Values
Returns the value collection.
Declaration
public SortedDictionary<TKey, TValue>.ValueCollection Values { get; }
Property Value
|
SortedDictionary.ValueCollection<>
|
Methods
Add(TKey, TValue)
Adds a new key value pair.
Declaration
public void Add(TKey key, TValue value)
Parameters
|
TKey
key
|
|
TValue
value
|
Clear()
Clears all items.
Declaration
public void Clear()
ContainsKey(TKey)
Returns true if the given key is in this dictionary.
Declaration
public bool ContainsKey(TKey key)
Parameters
|
TKey
key
|
Returns
|
System.Boolean
|
ContainsValue(TValue)
Return true if the given value is in this dictionary.
Declaration
public bool ContainsValue(TValue value)
Parameters
|
TValue
value
|
Returns
|
System.Boolean
|
CopyTo(KeyValuePair<TKey, TValue>[], Int32)
Copies all key value pairs to this dictionary.
Declaration
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
Parameters
|
KeyValuePair<TKey, TValue>[]
array
|
|
System.Int32
arrayIndex
|
GetEnumerator()
Returns the enumerator.
Declaration
public SortedDictionary<TKey, TValue>.Enumerator GetEnumerator()
Returns
|
SortedDictionary.Enumerator<>
|
Remove(TKey)
Removes the item associated with the key.
Declaration
public bool Remove(TKey key)
Parameters
|
TKey
key
|
Returns
|
System.Boolean
|
TryGetValue(TKey, out TValue)
Gets the value associated with the given key.
Declaration
public bool TryGetValue(TKey key, out TValue value)
Parameters
|
TKey
key
|
|
TValue
value
|
Returns
|
System.Boolean
|