OrderedDictionary<TKey, TValue>
Represents a generic collection of key/value pairs that are ordered independently of the key and value.
Assembly: ServiceStack.Api.OpenApi.dll
View Source
public class OrderedDictionary<TKey, TValue> : IOrderedDictionary<TKey, TValue>, IOrderedDictionary, IDictionary, ICollection, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
Properties
Item[Int32]
Gets or sets the value at the specified index.
View Source
public TValue this[int index] { get; set; }
IOrderedDictionary.Item[Int32]
Gets or sets the value at the specified index.
View Source
object IOrderedDictionary.this[int index] { get; set; }
IDictionary.IsFixedSize
Gets a value indicating whether the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
has a fixed size.
View Source
bool IDictionary.IsFixedSize { get; }
IsReadOnly
Gets a value indicating whether the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
collection is read-only.
View Source
public bool IsReadOnly { get; }
IDictionary.Keys
Gets an System.Collections.ICollection
object containing the keys in the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
.
View Source
ICollection IDictionary.Keys { get; }
IDictionary.Values
Gets an System.Collections.ICollection
object containing the values in the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
collection.
View Source
ICollection IDictionary.Values { get; }
Item[TKey]
Gets or sets the value with the specified key.
View Source
public TValue this[TKey key] { get; set; }
IDictionary.Item[Object]
Gets or sets the value with the specified key.
View Source
object IDictionary.this[object key] { get; set; }
Count
Gets the number of key/values pairs contained in the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
collection.
View Source
public int Count { get; }
ICollection.IsSynchronized
Gets a value indicating whether access to the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
object is synchronized (thread-safe).
View Source
bool ICollection.IsSynchronized { get; }
ICollection.SyncRoot
Gets an object that can be used to synchronize access to the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
object.
View Source
object ICollection.SyncRoot { get; }
Keys
Gets an System.Collections.Generic.ICollection%7bTKey%7d?text=ICollection%3cTKey%3e
object containing the keys in the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
.
View Source
public ICollection<TKey> Keys { get; }
Values
Gets an ICollection%7bTValue%7d?text=ICollection%3cTValue%3e
object containing the values in the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
.
View Source
public ICollection<TValue> Values { get; }
Methods
IOrderedDictionary.GetEnumerator()
View Source
IDictionaryEnumerator IOrderedDictionary.GetEnumerator()
Returns
System.Collections.IDictionaryEnumerator
IDictionary.GetEnumerator()
View Source
IDictionaryEnumerator IDictionary.GetEnumerator()
Returns
System.Collections.IDictionaryEnumerator
IEnumerable.GetEnumerator()
View Source
IEnumerator IEnumerable.GetEnumerator()
Returns
System.Collections.IEnumerator
IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()
View Source
IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()
Returns
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<<TKey>,<TValue>>>
Insert(Int32, TKey, TValue)
Inserts a new entry into the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
collection with the specified key and value at the specified index.
View Source
public void Insert(int index, TKey key, TValue value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index at which the element should be inserted. |
|
| <TKey>
| key | The key of the entry to add.
|
| <TValue>
| value | The value of the entry to add. The value can be <null></null> if the type of the values in the dictionary is a reference type.
|
IOrderedDictionary.Insert(Int32, Object, Object)
Inserts a new entry into the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
collection with the specified key and value at the specified index.
View Source
void IOrderedDictionary.Insert(int index, object key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index at which the element should be inserted. |
|
| System.Object
| key | The key of the entry to add.
|
| System.Object
| value | The value of the entry to add. The value can be <null></null> if the type of the values in the dictionary is a reference type.
|
RemoveAt(Int32)
Removes the entry at the specified index from the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
collection.
View Source
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index of the entry to remove. |
|
IDictionary<TKey, TValue>.Add(TKey, TValue)
Adds an entry with the specified key and value into the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
collection with the lowest available index.
A key cannot be <null></null>, but a value can be. <p>You can also use the <xref href="OrderedDictionary%7bTKey%2cTValue%7d.Item(TKey)" data-throw-if-not-resolved="false"></xref> property to add new elements by setting the value of a key that does not exist in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref> collection; however, if the specified key already exists in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref>, setting the <xref href="OrderedDictionary%7bTKey%2cTValue%7d.Item(TKey)" data-throw-if-not-resolved="false"></xref> property overwrites the old value. In contrast, the <xref href="Add" data-throw-if-not-resolved="false"></xref> method does not modify existing elements.</p>
View Source
void IDictionary<TKey, TValue>.Add(TKey key, TValue value)
Parameters
Type | Name | Description |
---|---|---|
<TKey> | key | The key of the entry to add. |
A key cannot be <null></null>, but a value can be.
<p>You can also use the <xref href="OrderedDictionary%7bTKey%2cTValue%7d.Item(TKey)" data-throw-if-not-resolved="false"></xref> property to add new elements by setting the value of a key that does not exist in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref> collection; however, if the specified key already exists in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref>, setting the <xref href="OrderedDictionary%7bTKey%2cTValue%7d.Item(TKey)" data-throw-if-not-resolved="false"></xref> property overwrites the old value. In contrast, the <xref href="Add" data-throw-if-not-resolved="false"></xref> method does not modify existing elements.</p>
|
| <TValue>
| value | The value of the entry to add. This value can be <null></null>.
A key cannot be <null></null>, but a value can be.
<p>You can also use the <xref href="OrderedDictionary%7bTKey%2cTValue%7d.Item(TKey)" data-throw-if-not-resolved="false"></xref> property to add new elements by setting the value of a key that does not exist in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref> collection; however, if the specified key already exists in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref>, setting the <xref href="OrderedDictionary%7bTKey%2cTValue%7d.Item(TKey)" data-throw-if-not-resolved="false"></xref> property overwrites the old value. In contrast, the <xref href="Add" data-throw-if-not-resolved="false"></xref> method does not modify existing elements.</p>
|
Add(TKey, TValue)
Adds an entry with the specified key and value into the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
collection with the lowest available index.
A key cannot be <null></null>, but a value can be. <p>You can also use the <xref href="OrderedDictionary%7bTKey%2cTValue%7d.Item(TKey)" data-throw-if-not-resolved="false"></xref> property to add new elements by setting the value of a key that does not exist in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref> collection; however, if the specified key already exists in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref>, setting the <xref href="OrderedDictionary%7bTKey%2cTValue%7d.Item(TKey)" data-throw-if-not-resolved="false"></xref> property overwrites the old value. In contrast, the <xref href="Add" data-throw-if-not-resolved="false"></xref> method does not modify existing elements.</p>
View Source
public int Add(TKey key, TValue value)
Returns
System.Int32
: The index of the newly added entry
A key cannot be <null></null>, but a value can be.
<p>You can also use the <xref href="OrderedDictionary%7bTKey%2cTValue%7d.Item(TKey)" data-throw-if-not-resolved="false"></xref> property to add new elements by setting the value of a key that does not exist in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref> collection; however, if the specified key already exists in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref>, setting the <xref href="OrderedDictionary%7bTKey%2cTValue%7d.Item(TKey)" data-throw-if-not-resolved="false"></xref> property overwrites the old value. In contrast, the <xref href="Add" data-throw-if-not-resolved="false"></xref> method does not modify existing elements.</p>
Parameters
Type | Name | Description |
---|---|---|
<TKey> | key | The key of the entry to add. |
A key cannot be <null></null>, but a value can be.
<p>You can also use the <xref href="OrderedDictionary%7bTKey%2cTValue%7d.Item(TKey)" data-throw-if-not-resolved="false"></xref> property to add new elements by setting the value of a key that does not exist in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref> collection; however, if the specified key already exists in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref>, setting the <xref href="OrderedDictionary%7bTKey%2cTValue%7d.Item(TKey)" data-throw-if-not-resolved="false"></xref> property overwrites the old value. In contrast, the <xref href="Add" data-throw-if-not-resolved="false"></xref> method does not modify existing elements.</p>
|
| <TValue>
| value | The value of the entry to add. This value can be <null></null>.
A key cannot be <null></null>, but a value can be.
<p>You can also use the <xref href="OrderedDictionary%7bTKey%2cTValue%7d.Item(TKey)" data-throw-if-not-resolved="false"></xref> property to add new elements by setting the value of a key that does not exist in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref> collection; however, if the specified key already exists in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref>, setting the <xref href="OrderedDictionary%7bTKey%2cTValue%7d.Item(TKey)" data-throw-if-not-resolved="false"></xref> property overwrites the old value. In contrast, the <xref href="Add" data-throw-if-not-resolved="false"></xref> method does not modify existing elements.</p>
|
IDictionary.Add(Object, Object)
Adds an entry with the specified key and value into the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
collection with the lowest available index.
View Source
void IDictionary.Add(object key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | The key of the entry to add. |
|
| System.Object
| value | The value of the entry to add. This value can be <null></null>.
|
Clear()
Removes all elements from the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
collection.
The capacity is not changed as a result of calling this method.
View Source
public void Clear()
ContainsKey(TKey)
Determines whether the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
collection contains a specific key.
View Source
public bool ContainsKey(TKey key)
Returns
System.Boolean
: true
if the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
collection contains an element with the specified key; otherwise, false
.
Parameters
Type | Name | Description |
---|---|---|
<TKey> | key | The key to locate in the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e collection. |
|
IDictionary.Contains(Object)
Determines whether the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
collection contains a specific key.
View Source
bool IDictionary.Contains(object key)
Returns
System.Boolean
: true
if the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
collection contains an element with the specified key; otherwise, false
.
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | The key to locate in the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e collection. |
|
IndexOfKey(TKey)
Returns the zero-based index of the specified key in the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
This method performs a linear search; therefore it has a cost of O(n) at worst.
View Source
public int IndexOfKey(TKey key)
Returns
System.Int32
: The zero-based index of <code data-dev-comment-type="paramref" class="paramref">key</code>, if <code data-dev-comment-type="paramref" class="paramref">key</code> is found in the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
; otherwise, -1
This method performs a linear search; therefore it has a cost of O(n) at worst.
Parameters
Type | Name | Description |
---|---|---|
<TKey> | key | The key to locate in the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e |
This method performs a linear search; therefore it has a cost of O(n) at worst. |
Remove(TKey)
Removes the entry with the specified key from the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
collection.
View Source
public bool Remove(TKey key)
Returns
System.Boolean
: true
if the key was found and the corresponding element was removed; otherwise, false
Parameters
Type | Name | Description |
---|---|---|
<TKey> | key | The key of the entry to remove |
|
IDictionary.Remove(Object)
Removes the entry with the specified key from the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
collection.
View Source
void IDictionary.Remove(object key)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | The key of the entry to remove |
|
ICollection.CopyTo(Array, Int32)
Copies the elements of the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
elements to a one-dimensional Array object at the specified index.
The <xref href="CopyTo" data-throw-if-not-resolved="false"></xref> method preserves the order of the elements in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref>
View Source
void ICollection.CopyTo(Array array, int index)
Parameters
Type | Name | Description |
---|---|---|
System.Array | array | The one-dimensional System.Array object that is the destination of the KeyValuePair%602%3e objects copied from the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e . The System.Array must have zero-based indexing. |
The <xref href="CopyTo" data-throw-if-not-resolved="false"></xref> method preserves the order of the elements in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref>
|
| System.Int32
| index | The zero-based index in <code data-dev-comment-type="paramref" class="paramref">array</code> at which copying begins.
The <xref href="CopyTo" data-throw-if-not-resolved="false"></xref> method preserves the order of the elements in the <xref href="ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e" data-throw-if-not-resolved="false"></xref>
|
TryGetValue(TKey, out TValue)
Gets the value associated with the specified key.
View Source
public bool TryGetValue(TKey key, out TValue value)
Returns
System.Boolean
: true
if the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
contains an element with the specified key; otherwise, false
.
Parameters
Type | Name | Description |
---|---|---|
<TKey> | key | The key of the value to get. |
|
| <TValue>
| value | When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value for the type of <code data-dev-comment-type="paramref" class="paramref">value</code>. This parameter can be passed uninitialized.
|
ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue>)
Adds the specified value to the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
with the specified key.
View Source
void ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue> item)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.KeyValuePair<<TKey>,<TValue>> | item | The KeyValuePair%7bTKey%2cTValue%7d?text=KeyValuePair%3cTKey%2cTValue%3e structure representing the key and value to add to the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e . |
|
ICollection<KeyValuePair<TKey, TValue>>.Contains(KeyValuePair<TKey, TValue>)
Determines whether the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
contains a specific key and value.
View Source
bool ICollection<KeyValuePair<TKey, TValue>>.Contains(KeyValuePair<TKey, TValue> item)
Returns
System.Boolean
: true
if <code data-dev-comment-type="paramref" class="paramref">item</code> is found in the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
; otherwise, false
.
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.KeyValuePair<<TKey>,<TValue>> | item | The KeyValuePair%7bTKey%2cTValue%7d?text=KeyValuePair%3cTKey%2cTValue%3e structure to locate in the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e . |
|
ICollection<KeyValuePair<TKey, TValue>>.CopyTo(KeyValuePair<TKey, TValue>[], Int32)
Copies the elements of the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
to an array of type KeyValuePair%602%3e
, starting at the specified index.
View Source
void ICollection<KeyValuePair<TKey, TValue>>.CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.KeyValuePair<<TKey>,<TValue>>[] | array | The one-dimensional array of type KeyValuePair%7bTKey%2cTValue%7d?text=KeyValuePair%3cTKey%2cTValue%3e that is the destination of the KeyValuePair%7bTKey%2cTValue%7d?text=KeyValuePair%3cTKey%2cTValue%3e elements copied from the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e . The array must have zero-based indexing. |
|
| System.Int32
| arrayIndex | The zero-based index in <code data-dev-comment-type="paramref" class="paramref">array</code> at which copying begins.
|
ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue>)
Removes a key and value from the dictionary.
View Source
bool ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue> item)
Returns
System.Boolean
: true
if the key and value represented by <code data-dev-comment-type="paramref" class="paramref">item</code> is successfully found and removed; otherwise, false
. This method returns false
if <code data-dev-comment-type="paramref" class="paramref">item</code> is not found in the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e
.
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.KeyValuePair<<TKey>,<TValue>> | item | The KeyValuePair%7bTKey%2cTValue%7d?text=KeyValuePair%3cTKey%2cTValue%3e structure representing the key and value to remove from the ServiceStack.Api.OpenApi.Support.OrderedDictionary%602?text=OrderedDictionary%3cTKey%2cTValue%3e . |
|
Implements
ServiceStack.Api.OpenApi.Support.IOrderedDictionary<<TKey>,<TValue>>
System.Collections.Specialized.IOrderedDictionary
System.Collections.IDictionary
System.Collections.ICollection
System.Collections.Generic.IDictionary<<TKey>,<TValue>>
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<<TKey>,<TValue>>>
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<<TKey>,<TValue>>>
System.Collections.IEnumerable