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.​Specialized.​OrderedDictionary

Assembly: System.Collections.Specialized

Inheritance: object → OrderedDictionary

Implemented Interfaces

Represents a collection of key/value pairs that are accessible by the key or index.

Properties

public int
Count
Gets the number of key/values pairs contained in the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.
public bool
IsReadOnly
Gets a value indicating whether the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection is read-only.
public object
Item
public object
Item
public ICollection
Keys
Gets an <see cref="T:System.Collections.ICollection" /> object containing the keys in the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.
public ICollection
Values
Gets an <see cref="T:System.Collections.ICollection" /> object containing the values in the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.

Methods

public void
Add​(object key, object value)
Adds an entry with the specified key and value into the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection with the lowest available index.
key The key of the entry to add.
value The value of the entry to add. This value can be <see langword="null" /> .
AsReadOnly​()
Returns a read-only copy of the current <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.
Returns A read-only copy of the current <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.
public void
Clear​()
Removes all elements from the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.
public bool
Contains​(object key)
Determines whether the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection contains a specific key.
Returns <see langword="true" /> if the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection contains an element with the specified key; otherwise, <see langword="false" /> .
key The key to locate in the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.
public void
CopyTo​(Array array, int index)
Copies the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> elements to a one-dimensional <see cref="T:System.Array" /> object at the specified index.
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.Specialized.OrderedDictionary" /> collection. The <see cref="T:System.Array" /> must have zero-based indexing.
index The zero-based index in <paramref name="array" /> at which copying begins.
GetEnumerator​()
Returns an <see cref="T:System.Collections.IDictionaryEnumerator" /> object that iterates through the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.
Returns An <see cref="T:System.Collections.IDictionaryEnumerator" /> object for the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.
public void
GetObjectData​(Runtime.​Serialization.​SerializationInfo info, Runtime.​Serialization.​StreamingContext context)
Implements the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface and returns the data needed to serialize the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.
info A <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object containing the information required to serialize the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.
context A <see cref="T:System.Runtime.Serialization.StreamingContext" /> object containing the source and destination of the serialized stream associated with the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> .
public void
Insert​(int index, object key, object value)
Inserts a new entry into the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection with the specified key and value at the specified index.
index The zero-based index at which the element should be inserted.
key The key of the entry to add.
value The value of the entry to add. The value can be <see langword="null" /> .
protected void
OnDeserialization​(object sender)
Implements the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface and is called back by the deserialization event when deserialization is complete.
sender The source of the deserialization event.
public void
Remove​(object key)
Removes the entry with the specified key from the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.
key The key of the entry to remove.
public void
RemoveAt​(int index)
Removes the entry at the specified index from the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.
index The zero-based index of the entry to remove.
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