Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Collections.​SortedList

Assembly: System.Collections.NonGeneric

Inheritance: object → SortedList

Represents a collection of key/value pairs that are sorted by the keys and are accessible by key and by index.

Properties

public int
Capacity
Gets or sets the capacity of a <see cref="T:System.Collections.SortedList" /> object.
public int
Count
Gets the number of elements contained in a <see cref="T:System.Collections.SortedList" /> object.
public bool
IsFixedSize
Gets a value indicating whether a <see cref="T:System.Collections.SortedList" /> object has a fixed size.
public bool
IsReadOnly
Gets a value indicating whether a <see cref="T:System.Collections.SortedList" /> object is read-only.
public bool
IsSynchronized
Gets a value indicating whether access to a <see cref="T:System.Collections.SortedList" /> object is synchronized (thread safe).
public object
Item
public ICollection
Keys
Gets the keys in a <see cref="T:System.Collections.SortedList" /> object.
public object
SyncRoot
Gets an object that can be used to synchronize access to a <see cref="T:System.Collections.SortedList" /> object.
public ICollection
Values
Gets the values in a <see cref="T:System.Collections.SortedList" /> object.

Methods

public void
Add​(object key, object value)
key The key of the element to add.
value The value of the element to add. The value can be <see langword="null" /> .
Adds an element with the specified key and value to a <see cref="T:System.Collections.SortedList" /> object.
public void
Clear​()
Removes all elements from a <see cref="T:System.Collections.SortedList" /> object.
public object
Clone​()
Returns A shallow copy of the <see cref="T:System.Collections.SortedList" /> object.
Creates a shallow copy of a <see cref="T:System.Collections.SortedList" /> object.
public bool
Contains​(object key)
key The key to locate in the <see cref="T:System.Collections.SortedList" /> object.
Returns <see langword="true" /> if the <see cref="T:System.Collections.SortedList" /> object contains an element with the specified <paramref name="key" /> ; otherwise, <see langword="false" /> .
Determines whether a <see cref="T:System.Collections.SortedList" /> object contains a specific key.
public bool
ContainsKey​(object key)
key The key to locate in the <see cref="T:System.Collections.SortedList" /> object.
Returns <see langword="true" /> if the <see cref="T:System.Collections.SortedList" /> object contains an element with the specified <paramref name="key" /> ; otherwise, <see langword="false" /> .
Determines whether a <see cref="T:System.Collections.SortedList" /> object contains a specific key.
public bool
ContainsValue​(object value)
value The value to locate in the <see cref="T:System.Collections.SortedList" /> object. The value can be <see langword="null" /> .
Returns <see langword="true" /> if the <see cref="T:System.Collections.SortedList" /> object contains an element with the specified <paramref name="value" /> ; otherwise, <see langword="false" /> .
Determines whether a <see cref="T:System.Collections.SortedList" /> object contains a specific value.
public void
CopyTo​(Array array, int arrayIndex)
array The one-dimensional <see cref="T:System.Array" /> object that is the destination of the <see cref="T:System.Collections.DictionaryEntry" /> objects copied from <see cref="T:System.Collections.SortedList" /> . The <see cref="T:System.Array" /> must have zero-based indexing.
arrayIndex The zero-based index in <paramref name="array" /> at which copying begins.
Copies <see cref="T:System.Collections.SortedList" /> elements to a one-dimensional <see cref="T:System.Array" /> object, starting at the specified index in the array.
public object
GetByIndex​(int index)
index The zero-based index of the value to get.
Returns The value at the specified index of the <see cref="T:System.Collections.SortedList" /> object.
Gets the value at the specified index of a <see cref="T:System.Collections.SortedList" /> object.
GetEnumerator​()
Returns An <see cref="T:System.Collections.IDictionaryEnumerator" /> object for the <see cref="T:System.Collections.SortedList" /> object.
Returns an <see cref="T:System.Collections.IDictionaryEnumerator" /> object that iterates through a <see cref="T:System.Collections.SortedList" /> object.
public object
GetKey​(int index)
index The zero-based index of the key to get.
Returns The key at the specified index of the <see cref="T:System.Collections.SortedList" /> object.
Gets the key at the specified index of a <see cref="T:System.Collections.SortedList" /> object.
public IList
GetKeyList​()
Returns An <see cref="T:System.Collections.IList" /> object containing the keys in the <see cref="T:System.Collections.SortedList" /> object.
Gets the keys in a <see cref="T:System.Collections.SortedList" /> object.
public IList
GetValueList​()
Returns An <see cref="T:System.Collections.IList" /> object containing the values in the <see cref="T:System.Collections.SortedList" /> object.
Gets the values in a <see cref="T:System.Collections.SortedList" /> object.
public int
IndexOfKey​(object key)
key The key to locate in the <see cref="T:System.Collections.SortedList" /> object.
Returns The zero-based index of the <paramref name="key" /> parameter, if <paramref name="key" /> is found in the <see cref="T:System.Collections.SortedList" /> object; otherwise, -1.
Returns the zero-based index of the specified key in a <see cref="T:System.Collections.SortedList" /> object.
public int
IndexOfValue​(object value)
value The value to locate in the <see cref="T:System.Collections.SortedList" /> object. The value can be <see langword="null" /> .
Returns The zero-based index of the first occurrence of the <paramref name="value" /> parameter, if <paramref name="value" /> is found in the <see cref="T:System.Collections.SortedList" /> object; otherwise, -1.
Returns the zero-based index of the first occurrence of the specified value in a <see cref="T:System.Collections.SortedList" /> object.
public void
Remove​(object key)
key The key of the element to remove.
Removes the element with the specified key from a <see cref="T:System.Collections.SortedList" /> object.
public void
RemoveAt​(int index)
index The zero-based index of the element to remove.
Removes the element at the specified index of a <see cref="T:System.Collections.SortedList" /> object.
public void
SetByIndex​(int index, object value)
index The zero-based index at which to save <paramref name="value" /> .
value The <see cref="T:System.Object" /> to save into the <see cref="T:System.Collections.SortedList" /> object. The value can be <see langword="null" /> .
Replaces the value at a specific index in a <see cref="T:System.Collections.SortedList" /> object.
public void
TrimToSize​()
Sets the capacity to the actual number of elements in a <see cref="T:System.Collections.SortedList" /> object.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object