This commit is contained in:
niko
2026-06-04 11:42:34 +02:00
parent f39ba70a9f
commit e720b98cd1
7488 changed files with 2493818 additions and 0 deletions
+731
View File
@@ -0,0 +1,731 @@
using System;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
namespace System.Collections.Generic
{
/// <summary>Represents a doubly linked list.</summary>
/// <typeparam name="T">Specifies the element type of the linked list.</typeparam>
/// <filterpriority>1</filterpriority>
// Token: 0x0200000B RID: 11
[ComVisible(false)]
[Serializable]
public class LinkedList<T> : IEnumerable<T>, ICollection, IDeserializationCallback, IEnumerable, ICollection<T>, ISerializable
{
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.LinkedList`1" /> class that is empty.</summary>
// Token: 0x0600000F RID: 15 RVA: 0x00002188 File Offset: 0x00000388
public LinkedList()
{
this.syncRoot = new object();
this.first = null;
this.count = (this.version = 0U);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.LinkedList`1" /> class that contains elements copied from the specified <see cref="T:System.Collections.IEnumerable" /> and has sufficient capacity to accommodate the number of elements copied. </summary>
/// <param name="collection">The <see cref="T:System.Collections.IEnumerable" /> whose elements are copied to the new <see cref="T:System.Collections.Generic.LinkedList`1" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="collection" /> is null.</exception>
// Token: 0x06000010 RID: 16 RVA: 0x000021C0 File Offset: 0x000003C0
public LinkedList(IEnumerable<T> collection)
: this()
{
foreach (T t in collection)
{
this.AddLast(t);
}
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.LinkedList`1" /> class that is serializable with the specified <see cref="T:System.Runtime.Serialization.SerializationInfo" /> and <see cref="T:System.Runtime.Serialization.StreamingContext" />.</summary>
/// <param name="info">A <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object containing the information required to serialize the <see cref="T:System.Collections.Generic.LinkedList`1" />.</param>
/// <param name="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.Generic.LinkedList`1" />.</param>
// Token: 0x06000011 RID: 17 RVA: 0x00002228 File Offset: 0x00000428
protected LinkedList(SerializationInfo info, StreamingContext context)
: this()
{
this.si = info;
this.syncRoot = new object();
}
// Token: 0x06000012 RID: 18 RVA: 0x00002244 File Offset: 0x00000444
void ICollection<T>.Add(T value)
{
this.AddLast(value);
}
/// <summary>Copies the elements of the <see cref="T:System.Collections.ICollection" /> to an <see cref="T:System.Array" />, starting at a particular <see cref="T:System.Array" /> index.</summary>
/// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from <see cref="T:System.Collections.ICollection" />. The <see cref="T:System.Array" /> must have zero-based indexing.</param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or-<paramref name="array" /> does not have zero-based indexing.-or-The number of elements in the source <see cref="T:System.Collections.ICollection" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.-or-The type of the source <see cref="T:System.Collections.ICollection" /> cannot be cast automatically to the type of the destination <paramref name="array" />.</exception>
// Token: 0x06000013 RID: 19 RVA: 0x00002250 File Offset: 0x00000450
void ICollection.CopyTo(Array array, int index)
{
T[] array2 = array as T[];
if (array2 == null)
{
throw new ArgumentException("array");
}
this.CopyTo(array2, index);
}
// Token: 0x06000014 RID: 20 RVA: 0x00002280 File Offset: 0x00000480
IEnumerator<T> IEnumerable<T>.GetEnumerator()
{
return this.GetEnumerator();
}
/// <summary>Returns an enumerator that iterates through the linked list as a collection.</summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> that can be used to iterate through the linked list as a collection.</returns>
// Token: 0x06000015 RID: 21 RVA: 0x00002290 File Offset: 0x00000490
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
// Token: 0x17000004 RID: 4
// (get) Token: 0x06000016 RID: 22 RVA: 0x000022A0 File Offset: 0x000004A0
bool ICollection<T>.IsReadOnly
{
get
{
return false;
}
}
/// <summary>Gets a value indicating whether access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe).</summary>
/// <returns>true if access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe); otherwise, false. In the default implementation of <see cref="T:System.Collections.Generic.LinkedList`1" />, this property always returns false.</returns>
// Token: 0x17000005 RID: 5
// (get) Token: 0x06000017 RID: 23 RVA: 0x000022A4 File Offset: 0x000004A4
bool ICollection.IsSynchronized
{
get
{
return false;
}
}
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />.</summary>
/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />. In the default implementation of <see cref="T:System.Collections.Generic.LinkedList`1" />, this property always returns the current instance.</returns>
// Token: 0x17000006 RID: 6
// (get) Token: 0x06000018 RID: 24 RVA: 0x000022A8 File Offset: 0x000004A8
object ICollection.SyncRoot
{
get
{
return this.syncRoot;
}
}
// Token: 0x06000019 RID: 25 RVA: 0x000022B0 File Offset: 0x000004B0
private void VerifyReferencedNode(LinkedListNode<T> node)
{
if (node == null)
{
throw new ArgumentNullException("node");
}
if (node.List != this)
{
throw new InvalidOperationException();
}
}
// Token: 0x0600001A RID: 26 RVA: 0x000022D8 File Offset: 0x000004D8
private static void VerifyBlankNode(LinkedListNode<T> newNode)
{
if (newNode == null)
{
throw new ArgumentNullException("newNode");
}
if (newNode.List != null)
{
throw new InvalidOperationException();
}
}
/// <summary>Adds a new node containing the specified value after the specified existing node in the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <returns>The new <see cref="T:System.Collections.Generic.LinkedListNode`1" /> containing <paramref name="value" />.</returns>
/// <param name="node">The <see cref="T:System.Collections.Generic.LinkedListNode`1" /> after which to insert a new <see cref="T:System.Collections.Generic.LinkedListNode`1" /> containing <paramref name="value" />.</param>
/// <param name="value">The value to add to the <see cref="T:System.Collections.Generic.LinkedList`1" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="node" /> is null.</exception>
/// <exception cref="T:System.InvalidOperationException">
/// <paramref name="node" /> is not in the current <see cref="T:System.Collections.Generic.LinkedList`1" />.</exception>
// Token: 0x0600001B RID: 27 RVA: 0x00002308 File Offset: 0x00000508
public LinkedListNode<T> AddAfter(LinkedListNode<T> node, T value)
{
this.VerifyReferencedNode(node);
LinkedListNode<T> linkedListNode = new LinkedListNode<T>(this, value, node, node.forward);
this.count += 1U;
this.version += 1U;
return linkedListNode;
}
/// <summary>Adds the specified new node after the specified existing node in the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <param name="node">The <see cref="T:System.Collections.Generic.LinkedListNode`1" /> after which to insert <paramref name="newNode" />.</param>
/// <param name="newNode">The new <see cref="T:System.Collections.Generic.LinkedListNode`1" /> to add to the <see cref="T:System.Collections.Generic.LinkedList`1" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="node" /> is null.-or-<paramref name="newNode" /> is null.</exception>
/// <exception cref="T:System.InvalidOperationException">
/// <paramref name="node" /> is not in the current <see cref="T:System.Collections.Generic.LinkedList`1" />.-or-<paramref name="newNode" /> belongs to another <see cref="T:System.Collections.Generic.LinkedList`1" />.</exception>
// Token: 0x0600001C RID: 28 RVA: 0x00002348 File Offset: 0x00000548
public void AddAfter(LinkedListNode<T> node, LinkedListNode<T> newNode)
{
this.VerifyReferencedNode(node);
LinkedList<T>.VerifyBlankNode(newNode);
newNode.InsertBetween(node, node.forward, this);
this.count += 1U;
this.version += 1U;
}
/// <summary>Adds a new node containing the specified value before the specified existing node in the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <returns>The new <see cref="T:System.Collections.Generic.LinkedListNode`1" /> containing <paramref name="value" />.</returns>
/// <param name="node">The <see cref="T:System.Collections.Generic.LinkedListNode`1" /> before which to insert a new <see cref="T:System.Collections.Generic.LinkedListNode`1" /> containing <paramref name="value" />.</param>
/// <param name="value">The value to add to the <see cref="T:System.Collections.Generic.LinkedList`1" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="node" /> is null.</exception>
/// <exception cref="T:System.InvalidOperationException">
/// <paramref name="node" /> is not in the current <see cref="T:System.Collections.Generic.LinkedList`1" />.</exception>
// Token: 0x0600001D RID: 29 RVA: 0x0000238C File Offset: 0x0000058C
public LinkedListNode<T> AddBefore(LinkedListNode<T> node, T value)
{
this.VerifyReferencedNode(node);
LinkedListNode<T> linkedListNode = new LinkedListNode<T>(this, value, node.back, node);
this.count += 1U;
this.version += 1U;
if (node == this.first)
{
this.first = linkedListNode;
}
return linkedListNode;
}
/// <summary>Adds the specified new node before the specified existing node in the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <param name="node">The <see cref="T:System.Collections.Generic.LinkedListNode`1" /> before which to insert <paramref name="newNode" />.</param>
/// <param name="newNode">The new <see cref="T:System.Collections.Generic.LinkedListNode`1" /> to add to the <see cref="T:System.Collections.Generic.LinkedList`1" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="node" /> is null.-or-<paramref name="newNode" /> is null.</exception>
/// <exception cref="T:System.InvalidOperationException">
/// <paramref name="node" /> is not in the current <see cref="T:System.Collections.Generic.LinkedList`1" />.-or-<paramref name="newNode" /> belongs to another <see cref="T:System.Collections.Generic.LinkedList`1" />.</exception>
// Token: 0x0600001E RID: 30 RVA: 0x000023E0 File Offset: 0x000005E0
public void AddBefore(LinkedListNode<T> node, LinkedListNode<T> newNode)
{
this.VerifyReferencedNode(node);
LinkedList<T>.VerifyBlankNode(newNode);
newNode.InsertBetween(node.back, node, this);
this.count += 1U;
this.version += 1U;
if (node == this.first)
{
this.first = newNode;
}
}
/// <summary>Adds the specified new node at the start of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <param name="node">The new <see cref="T:System.Collections.Generic.LinkedListNode`1" /> to add at the start of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="node" /> is null.</exception>
/// <exception cref="T:System.InvalidOperationException">
/// <paramref name="node" /> belongs to another <see cref="T:System.Collections.Generic.LinkedList`1" />.</exception>
// Token: 0x0600001F RID: 31 RVA: 0x00002438 File Offset: 0x00000638
public void AddFirst(LinkedListNode<T> node)
{
LinkedList<T>.VerifyBlankNode(node);
if (this.first == null)
{
node.SelfReference(this);
}
else
{
node.InsertBetween(this.first.back, this.first, this);
}
this.count += 1U;
this.version += 1U;
this.first = node;
}
/// <summary>Adds a new node containing the specified value at the start of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <returns>The new <see cref="T:System.Collections.Generic.LinkedListNode`1" /> containing <paramref name="value" />.</returns>
/// <param name="value">The value to add at the start of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</param>
// Token: 0x06000020 RID: 32 RVA: 0x000024A0 File Offset: 0x000006A0
public LinkedListNode<T> AddFirst(T value)
{
LinkedListNode<T> linkedListNode;
if (this.first == null)
{
linkedListNode = new LinkedListNode<T>(this, value);
}
else
{
linkedListNode = new LinkedListNode<T>(this, value, this.first.back, this.first);
}
this.count += 1U;
this.version += 1U;
this.first = linkedListNode;
return linkedListNode;
}
/// <summary>Adds a new node containing the specified value at the end of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <returns>The new <see cref="T:System.Collections.Generic.LinkedListNode`1" /> containing <paramref name="value" />.</returns>
/// <param name="value">The value to add at the end of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</param>
// Token: 0x06000021 RID: 33 RVA: 0x00002504 File Offset: 0x00000704
public LinkedListNode<T> AddLast(T value)
{
LinkedListNode<T> linkedListNode;
if (this.first == null)
{
linkedListNode = new LinkedListNode<T>(this, value);
this.first = linkedListNode;
}
else
{
linkedListNode = new LinkedListNode<T>(this, value, this.first.back, this.first);
}
this.count += 1U;
this.version += 1U;
return linkedListNode;
}
/// <summary>Adds the specified new node at the end of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <param name="node">The new <see cref="T:System.Collections.Generic.LinkedListNode`1" /> to add at the end of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="node" /> is null.</exception>
/// <exception cref="T:System.InvalidOperationException">
/// <paramref name="node" /> belongs to another <see cref="T:System.Collections.Generic.LinkedList`1" />.</exception>
// Token: 0x06000022 RID: 34 RVA: 0x00002568 File Offset: 0x00000768
public void AddLast(LinkedListNode<T> node)
{
LinkedList<T>.VerifyBlankNode(node);
if (this.first == null)
{
node.SelfReference(this);
this.first = node;
}
else
{
node.InsertBetween(this.first.back, this.first, this);
}
this.count += 1U;
this.version += 1U;
}
/// <summary>Removes all nodes from the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
// Token: 0x06000023 RID: 35 RVA: 0x000025D0 File Offset: 0x000007D0
public void Clear()
{
while (this.first != null)
{
this.RemoveLast();
}
}
/// <summary>Determines whether a value is in the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <returns>true if <paramref name="value" /> is found in the <see cref="T:System.Collections.Generic.LinkedList`1" />; otherwise, false.</returns>
/// <param name="value">The value to locate in the <see cref="T:System.Collections.Generic.LinkedList`1" />. The value can be null for reference types.</param>
// Token: 0x06000024 RID: 36 RVA: 0x000025E8 File Offset: 0x000007E8
public bool Contains(T value)
{
LinkedListNode<T> forward = this.first;
if (forward == null)
{
return false;
}
while (!value.Equals(forward.Value))
{
forward = forward.forward;
if (forward == this.first)
{
return false;
}
}
return true;
}
/// <summary>Copies the entire <see cref="T:System.Collections.Generic.LinkedList`1" /> to a compatible one-dimensional <see cref="T:System.Array" />, starting at the specified index of the target array.</summary>
/// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from <see cref="T:System.Collections.Generic.LinkedList`1" />. The <see cref="T:System.Array" /> must have zero-based indexing.</param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero.</exception>
/// <exception cref="T:System.ArgumentException">The number of elements in the source <see cref="T:System.Collections.Generic.LinkedList`1" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.</exception>
// Token: 0x06000025 RID: 37 RVA: 0x00002638 File Offset: 0x00000838
public void CopyTo(T[] array, int index)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (index < array.GetLowerBound(0))
{
throw new ArgumentOutOfRangeException("index");
}
if (array.Rank != 1)
{
throw new ArgumentException("array", "Array is multidimensional");
}
if ((long)(array.Length - index + array.GetLowerBound(0)) < (long)((ulong)this.count))
{
throw new ArgumentException("number of items exceeds capacity");
}
LinkedListNode<T> forward = this.first;
if (this.first == null)
{
return;
}
do
{
array[index] = forward.Value;
index++;
forward = forward.forward;
}
while (forward != this.first);
}
/// <summary>Finds the first node that contains the specified value.</summary>
/// <returns>The first <see cref="T:System.Collections.Generic.LinkedListNode`1" /> that contains the specified value, if found; otherwise, null.</returns>
/// <param name="value">The value to locate in the <see cref="T:System.Collections.Generic.LinkedList`1" />.</param>
// Token: 0x06000026 RID: 38 RVA: 0x000026E8 File Offset: 0x000008E8
public LinkedListNode<T> Find(T value)
{
LinkedListNode<T> forward = this.first;
if (forward == null)
{
return null;
}
while ((value != null || forward.Value != null) && (value == null || !value.Equals(forward.Value)))
{
forward = forward.forward;
if (forward == this.first)
{
return null;
}
}
return forward;
}
/// <summary>Finds the last node that contains the specified value.</summary>
/// <returns>The last <see cref="T:System.Collections.Generic.LinkedListNode`1" /> that contains the specified value, if found; otherwise, null.</returns>
/// <param name="value">The value to locate in the <see cref="T:System.Collections.Generic.LinkedList`1" />.</param>
// Token: 0x06000027 RID: 39 RVA: 0x00002760 File Offset: 0x00000960
public LinkedListNode<T> FindLast(T value)
{
LinkedListNode<T> back = this.first;
if (back == null)
{
return null;
}
for (;;)
{
back = back.back;
if (value.Equals(back.Value))
{
break;
}
if (back == this.first)
{
goto Block_3;
}
}
return back;
Block_3:
return null;
}
/// <summary>Returns an enumerator that iterates through the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <returns>An <see cref="T:System.Collections.Generic.LinkedList`1.Enumerator" /> for the <see cref="T:System.Collections.Generic.LinkedList`1" />.</returns>
// Token: 0x06000028 RID: 40 RVA: 0x000027B0 File Offset: 0x000009B0
public LinkedList<T>.Enumerator GetEnumerator()
{
return new LinkedList<T>.Enumerator(this);
}
/// <summary>Implements the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface and returns the data needed to serialize the <see cref="T:System.Collections.Generic.LinkedList`1" /> instance.</summary>
/// <param name="info">A <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object that contains the information required to serialize the <see cref="T:System.Collections.Generic.LinkedList`1" /> instance.</param>
/// <param name="context">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> object that contains the source and destination of the serialized stream associated with the <see cref="T:System.Collections.Generic.LinkedList`1" /> instance.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="info" /> is null.</exception>
// Token: 0x06000029 RID: 41 RVA: 0x000027B8 File Offset: 0x000009B8
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
T[] array = new T[this.count];
this.CopyTo(array, 0);
info.AddValue("DataArray", array, typeof(T[]));
info.AddValue("version", this.version);
}
/// <summary>Implements the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface and raises the deserialization event when the deserialization is complete.</summary>
/// <param name="sender">The source of the deserialization event.</param>
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object associated with the current <see cref="T:System.Collections.Generic.LinkedList`1" /> instance is invalid.</exception>
// Token: 0x0600002A RID: 42 RVA: 0x00002804 File Offset: 0x00000A04
public virtual void OnDeserialization(object sender)
{
if (this.si != null)
{
T[] array = (T[])this.si.GetValue("DataArray", typeof(T[]));
if (array != null)
{
foreach (T t in array)
{
this.AddLast(t);
}
}
this.version = this.si.GetUInt32("version");
this.si = null;
}
}
/// <summary>Removes the first occurrence of the specified value from the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <returns>true if the element containing <paramref name="value" /> is successfully removed; otherwise, false. This method also returns false if <paramref name="value" /> was not found in the original <see cref="T:System.Collections.Generic.LinkedList`1" />.</returns>
/// <param name="value">The value to remove from the <see cref="T:System.Collections.Generic.LinkedList`1" />.</param>
// Token: 0x0600002B RID: 43 RVA: 0x00002888 File Offset: 0x00000A88
public bool Remove(T value)
{
LinkedListNode<T> linkedListNode = this.Find(value);
if (linkedListNode == null)
{
return false;
}
this.Remove(linkedListNode);
return true;
}
/// <summary>Removes the specified node from the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <param name="node">The <see cref="T:System.Collections.Generic.LinkedListNode`1" /> to remove from the <see cref="T:System.Collections.Generic.LinkedList`1" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="node" /> is null.</exception>
/// <exception cref="T:System.InvalidOperationException">
/// <paramref name="node" /> is not in the current <see cref="T:System.Collections.Generic.LinkedList`1" />.</exception>
// Token: 0x0600002C RID: 44 RVA: 0x000028B0 File Offset: 0x00000AB0
public void Remove(LinkedListNode<T> node)
{
this.VerifyReferencedNode(node);
this.count -= 1U;
if (this.count == 0U)
{
this.first = null;
}
if (node == this.first)
{
this.first = this.first.forward;
}
this.version += 1U;
node.Detach();
}
/// <summary>Removes the node at the start of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Collections.Generic.LinkedList`1" /> is empty.</exception>
// Token: 0x0600002D RID: 45 RVA: 0x00002918 File Offset: 0x00000B18
public void RemoveFirst()
{
if (this.first != null)
{
this.Remove(this.first);
}
}
/// <summary>Removes the node at the end of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Collections.Generic.LinkedList`1" /> is empty.</exception>
// Token: 0x0600002E RID: 46 RVA: 0x00002934 File Offset: 0x00000B34
public void RemoveLast()
{
if (this.first != null)
{
this.Remove(this.first.back);
}
}
/// <summary>Gets the number of nodes actually contained in the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <returns>The number of nodes actually contained in the <see cref="T:System.Collections.Generic.LinkedList`1" />.</returns>
// Token: 0x17000007 RID: 7
// (get) Token: 0x0600002F RID: 47 RVA: 0x00002954 File Offset: 0x00000B54
public int Count
{
get
{
return (int)this.count;
}
}
/// <summary>Gets the first node of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <returns>The first <see cref="T:System.Collections.Generic.LinkedListNode`1" /> of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</returns>
// Token: 0x17000008 RID: 8
// (get) Token: 0x06000030 RID: 48 RVA: 0x0000295C File Offset: 0x00000B5C
public LinkedListNode<T> First
{
get
{
return this.first;
}
}
/// <summary>Gets the last node of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <returns>The last <see cref="T:System.Collections.Generic.LinkedListNode`1" /> of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</returns>
// Token: 0x17000009 RID: 9
// (get) Token: 0x06000031 RID: 49 RVA: 0x00002964 File Offset: 0x00000B64
public LinkedListNode<T> Last
{
get
{
return (this.first == null) ? null : this.first.back;
}
}
// Token: 0x04000021 RID: 33
private const string DataArrayKey = "DataArray";
// Token: 0x04000022 RID: 34
private const string VersionKey = "version";
// Token: 0x04000023 RID: 35
private uint count;
// Token: 0x04000024 RID: 36
private uint version;
// Token: 0x04000025 RID: 37
private object syncRoot;
// Token: 0x04000026 RID: 38
internal LinkedListNode<T> first;
// Token: 0x04000027 RID: 39
internal SerializationInfo si;
/// <summary>Enumerates the elements of a <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
// Token: 0x0200000C RID: 12
[Serializable]
public struct Enumerator : IEnumerator<T>, IEnumerator, IDisposable
{
// Token: 0x06000032 RID: 50 RVA: 0x00002984 File Offset: 0x00000B84
internal Enumerator(LinkedList<T> parent)
{
this.list = parent;
this.current = null;
this.index = -1;
this.version = parent.version;
}
/// <summary>Gets the element at the current position of the enumerator.</summary>
/// <returns>The element in the collection at the current position of the enumerator.</returns>
/// <exception cref="T:System.InvalidOperationException">The enumerator is positioned before the first element of the collection or after the last element. </exception>
// Token: 0x1700000A RID: 10
// (get) Token: 0x06000033 RID: 51 RVA: 0x000029A8 File Offset: 0x00000BA8
object IEnumerator.Current
{
get
{
return this.Current;
}
}
/// <summary>Sets the enumerator to its initial position, which is before the first element in the collection. This class cannot be inherited.</summary>
/// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
// Token: 0x06000034 RID: 52 RVA: 0x000029B8 File Offset: 0x00000BB8
void IEnumerator.Reset()
{
if (this.list == null)
{
throw new ObjectDisposedException(null);
}
if (this.version != this.list.version)
{
throw new InvalidOperationException("list modified");
}
this.current = null;
this.index = -1;
}
/// <summary>Gets the element at the current position of the enumerator.</summary>
/// <returns>The element in the <see cref="T:System.Collections.Generic.LinkedList`1" /> at the current position of the enumerator.</returns>
// Token: 0x1700000B RID: 11
// (get) Token: 0x06000035 RID: 53 RVA: 0x00002A08 File Offset: 0x00000C08
public T Current
{
get
{
if (this.list == null)
{
throw new ObjectDisposedException(null);
}
if (this.current == null)
{
throw new InvalidOperationException();
}
return this.current.Value;
}
}
/// <summary>Advances the enumerator to the next element of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <returns>true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.</returns>
/// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
// Token: 0x06000036 RID: 54 RVA: 0x00002A44 File Offset: 0x00000C44
public bool MoveNext()
{
if (this.list == null)
{
throw new ObjectDisposedException(null);
}
if (this.version != this.list.version)
{
throw new InvalidOperationException("list modified");
}
if (this.current == null)
{
this.current = this.list.first;
}
else
{
this.current = this.current.forward;
if (this.current == this.list.first)
{
this.current = null;
}
}
if (this.current == null)
{
this.index = -1;
return false;
}
this.index++;
return true;
}
/// <summary>Releases all resources used by the <see cref="T:System.Collections.Generic.LinkedList`1.Enumerator" />.</summary>
// Token: 0x06000037 RID: 55 RVA: 0x00002AF8 File Offset: 0x00000CF8
public void Dispose()
{
if (this.list == null)
{
throw new ObjectDisposedException(null);
}
this.current = null;
this.list = null;
}
// Token: 0x04000028 RID: 40
private const string VersionKey = "version";
// Token: 0x04000029 RID: 41
private const string IndexKey = "index";
// Token: 0x0400002A RID: 42
private const string ListKey = "list";
// Token: 0x0400002B RID: 43
private LinkedList<T> list;
// Token: 0x0400002C RID: 44
private LinkedListNode<T> current;
// Token: 0x0400002D RID: 45
private int index;
// Token: 0x0400002E RID: 46
private uint version;
}
}
}
@@ -0,0 +1,133 @@
using System;
using System.Runtime.InteropServices;
namespace System.Collections.Generic
{
/// <summary>Represents a node in a <see cref="T:System.Collections.Generic.LinkedList`1" />. This class cannot be inherited.</summary>
/// <typeparam name="T">Specifies the element type of the linked list.</typeparam>
/// <filterpriority>1</filterpriority>
// Token: 0x0200000D RID: 13
[ComVisible(false)]
public sealed class LinkedListNode<T>
{
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.LinkedListNode`1" /> class, containing the specified value.</summary>
/// <param name="value">The value to contain in the <see cref="T:System.Collections.Generic.LinkedListNode`1" />.</param>
// Token: 0x06000038 RID: 56 RVA: 0x00002B28 File Offset: 0x00000D28
public LinkedListNode(T value)
{
this.item = value;
}
// Token: 0x06000039 RID: 57 RVA: 0x00002B38 File Offset: 0x00000D38
internal LinkedListNode(LinkedList<T> list, T value)
{
this.container = list;
this.item = value;
this.forward = this;
this.back = this;
}
// Token: 0x0600003A RID: 58 RVA: 0x00002B6C File Offset: 0x00000D6C
internal LinkedListNode(LinkedList<T> list, T value, LinkedListNode<T> previousNode, LinkedListNode<T> nextNode)
{
this.container = list;
this.item = value;
this.back = previousNode;
this.forward = nextNode;
previousNode.forward = this;
nextNode.back = this;
}
// Token: 0x0600003B RID: 59 RVA: 0x00002BAC File Offset: 0x00000DAC
internal void Detach()
{
this.back.forward = this.forward;
this.forward.back = this.back;
this.forward = (this.back = null);
this.container = null;
}
// Token: 0x0600003C RID: 60 RVA: 0x00002BF4 File Offset: 0x00000DF4
internal void SelfReference(LinkedList<T> list)
{
this.forward = this;
this.back = this;
this.container = list;
}
// Token: 0x0600003D RID: 61 RVA: 0x00002C0C File Offset: 0x00000E0C
internal void InsertBetween(LinkedListNode<T> previousNode, LinkedListNode<T> nextNode, LinkedList<T> list)
{
previousNode.forward = this;
nextNode.back = this;
this.forward = nextNode;
this.back = previousNode;
this.container = list;
}
/// <summary>Gets the <see cref="T:System.Collections.Generic.LinkedList`1" /> that the <see cref="T:System.Collections.Generic.LinkedListNode`1" /> belongs to.</summary>
/// <returns>A reference to the <see cref="T:System.Collections.Generic.LinkedList`1" /> that the <see cref="T:System.Collections.Generic.LinkedListNode`1" /> belongs to, or null if the <see cref="T:System.Collections.Generic.LinkedListNode`1" /> is not linked.</returns>
// Token: 0x1700000C RID: 12
// (get) Token: 0x0600003E RID: 62 RVA: 0x00002C34 File Offset: 0x00000E34
public LinkedList<T> List
{
get
{
return this.container;
}
}
/// <summary>Gets the next node in the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <returns>A reference to the next node in the <see cref="T:System.Collections.Generic.LinkedList`1" />, or null if the current node is the last element (<see cref="P:System.Collections.Generic.LinkedList`1.Last" />) of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</returns>
// Token: 0x1700000D RID: 13
// (get) Token: 0x0600003F RID: 63 RVA: 0x00002C3C File Offset: 0x00000E3C
public LinkedListNode<T> Next
{
get
{
return (this.container == null || this.forward == this.container.first) ? null : this.forward;
}
}
/// <summary>Gets the previous node in the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
/// <returns>A reference to the previous node in the <see cref="T:System.Collections.Generic.LinkedList`1" />, or null if the current node is the first element (<see cref="P:System.Collections.Generic.LinkedList`1.First" />) of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</returns>
// Token: 0x1700000E RID: 14
// (get) Token: 0x06000040 RID: 64 RVA: 0x00002C6C File Offset: 0x00000E6C
public LinkedListNode<T> Previous
{
get
{
return (this.container == null || this == this.container.first) ? null : this.back;
}
}
/// <summary>Gets the value contained in the node.</summary>
/// <returns>The value contained in the node.</returns>
// Token: 0x1700000F RID: 15
// (get) Token: 0x06000041 RID: 65 RVA: 0x00002CA4 File Offset: 0x00000EA4
// (set) Token: 0x06000042 RID: 66 RVA: 0x00002CAC File Offset: 0x00000EAC
public T Value
{
get
{
return this.item;
}
set
{
this.item = value;
}
}
// Token: 0x0400002F RID: 47
private T item;
// Token: 0x04000030 RID: 48
private LinkedList<T> container;
// Token: 0x04000031 RID: 49
internal LinkedListNode<T> forward;
// Token: 0x04000032 RID: 50
internal LinkedListNode<T> back;
}
}
+414
View File
@@ -0,0 +1,414 @@
using System;
using System.Runtime.InteropServices;
namespace System.Collections.Generic
{
/// <summary>Represents a first-in, first-out collection of objects.</summary>
/// <typeparam name="T">Specifies the type of elements in the queue.</typeparam>
/// <filterpriority>1</filterpriority>
// Token: 0x0200000E RID: 14
[ComVisible(false)]
[Serializable]
public class Queue<T> : IEnumerable<T>, ICollection, IEnumerable
{
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Queue`1" /> class that is empty and has the default initial capacity.</summary>
// Token: 0x06000043 RID: 67 RVA: 0x00002CB8 File Offset: 0x00000EB8
public Queue()
{
this._array = new T[0];
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Queue`1" /> class that is empty and has the specified initial capacity.</summary>
/// <param name="capacity">The initial number of elements that the <see cref="T:System.Collections.Generic.Queue`1" /> can contain.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="capacity" /> is less than zero.</exception>
// Token: 0x06000044 RID: 68 RVA: 0x00002CCC File Offset: 0x00000ECC
public Queue(int count)
{
if (count < 0)
{
throw new ArgumentOutOfRangeException("count");
}
this._array = new T[count];
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Queue`1" /> class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied.</summary>
/// <param name="collection">The collection whose elements are copied to the new <see cref="T:System.Collections.Generic.Queue`1" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="collection" /> is null.</exception>
// Token: 0x06000045 RID: 69 RVA: 0x00002D00 File Offset: 0x00000F00
public Queue(IEnumerable<T> collection)
{
if (collection == null)
{
throw new ArgumentNullException("collection");
}
ICollection<T> collection2 = collection as ICollection<T>;
int num = ((collection2 == null) ? 0 : collection2.Count);
this._array = new T[num];
foreach (T t in collection)
{
this.Enqueue(t);
}
}
/// <summary>Copies the elements of the <see cref="T:System.Collections.ICollection" /> to an <see cref="T:System.Array" />, starting at a particular <see cref="T:System.Array" /> index.</summary>
/// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from <see cref="T:System.Collections.ICollection" />. The <see cref="T:System.Array" /> must have zero-based indexing.</param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or-<paramref name="array" /> does not have zero-based indexing.-or-The number of elements in the source <see cref="T:System.Collections.ICollection" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.-or-The type of the source <see cref="T:System.Collections.ICollection" /> cannot be cast automatically to the type of the destination <paramref name="array" />.</exception>
// Token: 0x06000046 RID: 70 RVA: 0x00002D9C File Offset: 0x00000F9C
void ICollection.CopyTo(Array array, int idx)
{
if (array == null)
{
throw new ArgumentNullException();
}
if (idx > array.Length)
{
throw new ArgumentOutOfRangeException();
}
if (array.Length - idx < this._size)
{
throw new ArgumentOutOfRangeException();
}
if (this._size == 0)
{
return;
}
try
{
int num = this._array.Length;
int num2 = num - this._head;
Array.Copy(this._array, this._head, array, idx, Math.Min(this._size, num2));
if (this._size > num2)
{
Array.Copy(this._array, 0, array, idx + num2, this._size - num2);
}
}
catch (ArrayTypeMismatchException)
{
throw new ArgumentException();
}
}
/// <summary>Gets a value indicating whether access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe).</summary>
/// <returns>true if access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe); otherwise, false. In the default implementation of <see cref="T:System.Collections.Generic.Queue`1" />, this property always returns false.</returns>
// Token: 0x17000010 RID: 16
// (get) Token: 0x06000047 RID: 71 RVA: 0x00002E70 File Offset: 0x00001070
bool ICollection.IsSynchronized
{
get
{
return false;
}
}
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />.</summary>
/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />. In the default implementation of <see cref="T:System.Collections.Generic.Queue`1" />, this property always returns the current instance.</returns>
// Token: 0x17000011 RID: 17
// (get) Token: 0x06000048 RID: 72 RVA: 0x00002E74 File Offset: 0x00001074
object ICollection.SyncRoot
{
get
{
return this;
}
}
// Token: 0x06000049 RID: 73 RVA: 0x00002E78 File Offset: 0x00001078
IEnumerator<T> IEnumerable<T>.GetEnumerator()
{
return this.GetEnumerator();
}
/// <summary>Returns an enumerator that iterates through a collection.</summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> that can be used to iterate through the collection.</returns>
// Token: 0x0600004A RID: 74 RVA: 0x00002E88 File Offset: 0x00001088
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
/// <summary>Removes all objects from the <see cref="T:System.Collections.Generic.Queue`1" />.</summary>
/// <filterpriority>1</filterpriority>
// Token: 0x0600004B RID: 75 RVA: 0x00002E98 File Offset: 0x00001098
public void Clear()
{
Array.Clear(this._array, 0, this._array.Length);
this._head = (this._tail = (this._size = 0));
this._version++;
}
/// <summary>Determines whether an element is in the <see cref="T:System.Collections.Generic.Queue`1" />.</summary>
/// <returns>true if <paramref name="item" /> is found in the <see cref="T:System.Collections.Generic.Queue`1" />; otherwise, false.</returns>
/// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.Queue`1" />. The value can be null for reference types.</param>
// Token: 0x0600004C RID: 76 RVA: 0x00002EE0 File Offset: 0x000010E0
public bool Contains(T item)
{
if (item == null)
{
foreach (T t in this)
{
if (t == null)
{
return true;
}
}
}
else
{
foreach (T t2 in this)
{
if (item.Equals(t2))
{
return true;
}
}
}
return false;
}
/// <summary>Copies the <see cref="T:System.Collections.Generic.Queue`1" /> elements to an existing one-dimensional <see cref="T:System.Array" />, starting at the specified array index.</summary>
/// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from <see cref="T:System.Collections.Generic.Queue`1" />. The <see cref="T:System.Array" /> must have zero-based indexing.</param>
/// <param name="arrayIndex">The zero-based index in <paramref name="array" /> at which copying begins.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="arrayIndex" /> is less than zero.</exception>
/// <exception cref="T:System.ArgumentException">The number of elements in the source <see cref="T:System.Collections.Generic.Queue`1" /> is greater than the available space from <paramref name="arrayIndex" /> to the end of the destination <paramref name="array" />.</exception>
// Token: 0x0600004D RID: 77 RVA: 0x00002FCC File Offset: 0x000011CC
public void CopyTo(T[] array, int idx)
{
if (array == null)
{
throw new ArgumentNullException();
}
((ICollection)this).CopyTo(array, idx);
}
/// <summary>Removes and returns the object at the beginning of the <see cref="T:System.Collections.Generic.Queue`1" />.</summary>
/// <returns>The object that is removed from the beginning of the <see cref="T:System.Collections.Generic.Queue`1" />.</returns>
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Collections.Generic.Queue`1" /> is empty.</exception>
// Token: 0x0600004E RID: 78 RVA: 0x00002FE4 File Offset: 0x000011E4
public T Dequeue()
{
T t = this.Peek();
this._array[this._head] = default(T);
if (++this._head == this._array.Length)
{
this._head = 0;
}
this._size--;
this._version++;
return t;
}
/// <summary>Returns the object at the beginning of the <see cref="T:System.Collections.Generic.Queue`1" /> without removing it.</summary>
/// <returns>The object at the beginning of the <see cref="T:System.Collections.Generic.Queue`1" />.</returns>
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Collections.Generic.Queue`1" /> is empty.</exception>
// Token: 0x0600004F RID: 79 RVA: 0x00003054 File Offset: 0x00001254
public T Peek()
{
if (this._size == 0)
{
throw new InvalidOperationException();
}
return this._array[this._head];
}
/// <summary>Adds an object to the end of the <see cref="T:System.Collections.Generic.Queue`1" />.</summary>
/// <param name="item">The object to add to the <see cref="T:System.Collections.Generic.Queue`1" />. The value can be null for reference types.</param>
// Token: 0x06000050 RID: 80 RVA: 0x00003084 File Offset: 0x00001284
public void Enqueue(T item)
{
if (this._size == this._array.Length || this._tail == this._array.Length)
{
this.SetCapacity(Math.Max(Math.Max(this._size, this._tail) * 2, 4));
}
this._array[this._tail] = item;
if (++this._tail == this._array.Length)
{
this._tail = 0;
}
this._size++;
this._version++;
}
/// <summary>Copies the <see cref="T:System.Collections.Generic.Queue`1" /> elements to a new array.</summary>
/// <returns>A new array containing elements copied from the <see cref="T:System.Collections.Generic.Queue`1" />.</returns>
// Token: 0x06000051 RID: 81 RVA: 0x0000312C File Offset: 0x0000132C
public T[] ToArray()
{
T[] array = new T[this._size];
this.CopyTo(array, 0);
return array;
}
/// <summary>Sets the capacity to the actual number of elements in the <see cref="T:System.Collections.Generic.Queue`1" />, if that number is less than 90 percent of current capacity.</summary>
// Token: 0x06000052 RID: 82 RVA: 0x00003150 File Offset: 0x00001350
public void TrimExcess()
{
if ((double)this._size < (double)this._array.Length * 0.9)
{
this.SetCapacity(this._size);
}
}
// Token: 0x06000053 RID: 83 RVA: 0x00003180 File Offset: 0x00001380
private void SetCapacity(int new_size)
{
if (new_size == this._array.Length)
{
return;
}
if (new_size < this._size)
{
throw new InvalidOperationException("shouldnt happen");
}
T[] array = new T[new_size];
if (this._size > 0)
{
this.CopyTo(array, 0);
}
this._array = array;
this._tail = this._size;
this._head = 0;
this._version++;
}
/// <summary>Gets the number of elements contained in the <see cref="T:System.Collections.Generic.Queue`1" />.</summary>
/// <returns>The number of elements contained in the <see cref="T:System.Collections.Generic.Queue`1" />.</returns>
// Token: 0x17000012 RID: 18
// (get) Token: 0x06000054 RID: 84 RVA: 0x000031F8 File Offset: 0x000013F8
public int Count
{
get
{
return this._size;
}
}
/// <summary>Returns an enumerator that iterates through the <see cref="T:System.Collections.Generic.Queue`1" />.</summary>
/// <returns>An <see cref="T:System.Collections.Generic.Queue`1.Enumerator" /> for the <see cref="T:System.Collections.Generic.Queue`1" />.</returns>
// Token: 0x06000055 RID: 85 RVA: 0x00003200 File Offset: 0x00001400
public Queue<T>.Enumerator GetEnumerator()
{
return new Queue<T>.Enumerator(this);
}
// Token: 0x04000033 RID: 51
private T[] _array;
// Token: 0x04000034 RID: 52
private int _head;
// Token: 0x04000035 RID: 53
private int _tail;
// Token: 0x04000036 RID: 54
private int _size;
// Token: 0x04000037 RID: 55
private int _version;
/// <summary>Enumerates the elements of a <see cref="T:System.Collections.Generic.Queue`1" />.</summary>
// Token: 0x0200000F RID: 15
[Serializable]
public struct Enumerator : IEnumerator, IDisposable, IEnumerator<T>
{
// Token: 0x06000056 RID: 86 RVA: 0x00003208 File Offset: 0x00001408
internal Enumerator(Queue<T> q)
{
this.q = q;
this.idx = -2;
this.ver = q._version;
}
/// <summary>Sets the enumerator to its initial position, which is before the first element in the collection.</summary>
/// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
// Token: 0x06000057 RID: 87 RVA: 0x00003228 File Offset: 0x00001428
void IEnumerator.Reset()
{
if (this.ver != this.q._version)
{
throw new InvalidOperationException();
}
this.idx = -2;
}
/// <summary>Gets the element at the current position of the enumerator.</summary>
/// <returns>The element in the collection at the current position of the enumerator.</returns>
/// <exception cref="T:System.InvalidOperationException">The enumerator is positioned before the first element of the collection or after the last element. </exception>
// Token: 0x17000013 RID: 19
// (get) Token: 0x06000058 RID: 88 RVA: 0x0000325C File Offset: 0x0000145C
object IEnumerator.Current
{
get
{
return this.Current;
}
}
/// <summary>Releases all resources used by the <see cref="T:System.Collections.Generic.Queue`1.Enumerator" />.</summary>
// Token: 0x06000059 RID: 89 RVA: 0x0000326C File Offset: 0x0000146C
public void Dispose()
{
this.idx = -2;
}
/// <summary>Advances the enumerator to the next element of the <see cref="T:System.Collections.Generic.Queue`1" />.</summary>
/// <returns>true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.</returns>
/// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
// Token: 0x0600005A RID: 90 RVA: 0x00003278 File Offset: 0x00001478
public bool MoveNext()
{
if (this.ver != this.q._version)
{
throw new InvalidOperationException();
}
if (this.idx == -2)
{
this.idx = this.q._size;
}
return this.idx != -1 && --this.idx != -1;
}
/// <summary>Gets the element at the current position of the enumerator.</summary>
/// <returns>The element in the <see cref="T:System.Collections.Generic.Queue`1" /> at the current position of the enumerator.</returns>
/// <exception cref="T:System.InvalidOperationException">The enumerator is positioned before the first element of the collection or after the last element. </exception>
// Token: 0x17000014 RID: 20
// (get) Token: 0x0600005B RID: 91 RVA: 0x000032E8 File Offset: 0x000014E8
public T Current
{
get
{
if (this.idx < 0)
{
throw new InvalidOperationException();
}
return this.q._array[(this.q._size - 1 - this.idx + this.q._head) % this.q._array.Length];
}
}
// Token: 0x04000038 RID: 56
private const int NOT_STARTED = -2;
// Token: 0x04000039 RID: 57
private const int FINISHED = -1;
// Token: 0x0400003A RID: 58
private Queue<T> q;
// Token: 0x0400003B RID: 59
private int idx;
// Token: 0x0400003C RID: 60
private int ver;
}
}
}
+723
View File
@@ -0,0 +1,723 @@
using System;
namespace System.Collections.Generic
{
// Token: 0x02000010 RID: 16
internal class RBTree : IEnumerable, IEnumerable<RBTree.Node>
{
// Token: 0x0600005C RID: 92 RVA: 0x00003348 File Offset: 0x00001548
public RBTree(object hlp)
{
this.hlp = hlp;
}
// Token: 0x0600005D RID: 93 RVA: 0x00003358 File Offset: 0x00001558
IEnumerator<RBTree.Node> IEnumerable<RBTree.Node>.GetEnumerator()
{
return this.GetEnumerator();
}
// Token: 0x0600005E RID: 94 RVA: 0x00003368 File Offset: 0x00001568
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
// Token: 0x0600005F RID: 95 RVA: 0x00003378 File Offset: 0x00001578
private static List<RBTree.Node> alloc_path()
{
if (RBTree.cached_path == null)
{
return new List<RBTree.Node>();
}
List<RBTree.Node> list = RBTree.cached_path;
RBTree.cached_path = null;
return list;
}
// Token: 0x06000060 RID: 96 RVA: 0x000033A4 File Offset: 0x000015A4
private static void release_path(List<RBTree.Node> path)
{
if (RBTree.cached_path == null || RBTree.cached_path.Capacity < path.Capacity)
{
path.Clear();
RBTree.cached_path = path;
}
}
// Token: 0x06000061 RID: 97 RVA: 0x000033D4 File Offset: 0x000015D4
public void Clear()
{
this.root = null;
this.version += 1U;
}
// Token: 0x06000062 RID: 98 RVA: 0x000033EC File Offset: 0x000015EC
public RBTree.Node Intern<T>(T key, RBTree.Node new_node)
{
if (this.root == null)
{
if (new_node == null)
{
new_node = ((RBTree.INodeHelper<T>)this.hlp).CreateNode(key);
}
this.root = new_node;
this.root.IsBlack = true;
this.version += 1U;
return this.root;
}
List<RBTree.Node> list = RBTree.alloc_path();
int num = this.find_key<T>(key, list);
RBTree.Node node = list[list.Count - 1];
if (node == null)
{
if (new_node == null)
{
new_node = ((RBTree.INodeHelper<T>)this.hlp).CreateNode(key);
}
node = this.do_insert(num, new_node, list);
}
RBTree.release_path(list);
return node;
}
// Token: 0x06000063 RID: 99 RVA: 0x00003494 File Offset: 0x00001694
public RBTree.Node Remove<T>(T key)
{
if (this.root == null)
{
return null;
}
List<RBTree.Node> list = RBTree.alloc_path();
int num = this.find_key<T>(key, list);
RBTree.Node node = null;
if (num == 0)
{
node = this.do_remove(list);
}
RBTree.release_path(list);
return node;
}
// Token: 0x06000064 RID: 100 RVA: 0x000034D4 File Offset: 0x000016D4
public RBTree.Node Lookup<T>(T key)
{
RBTree.INodeHelper<T> nodeHelper = (RBTree.INodeHelper<T>)this.hlp;
RBTree.Node node;
int num;
for (node = this.root; node != null; node = ((num >= 0) ? node.right : node.left))
{
num = nodeHelper.Compare(key, node);
if (num == 0)
{
break;
}
}
return node;
}
// Token: 0x17000015 RID: 21
// (get) Token: 0x06000065 RID: 101 RVA: 0x00003530 File Offset: 0x00001730
public int Count
{
get
{
return (int)((this.root != null) ? this.root.Size : 0U);
}
}
// Token: 0x17000016 RID: 22
public RBTree.Node this[int index]
{
get
{
if (index < 0 || index >= this.Count)
{
throw new IndexOutOfRangeException("index");
}
RBTree.Node node = this.root;
while (node != null)
{
int num = (int)((node.left != null) ? node.left.Size : 0U);
if (index == num)
{
return node;
}
if (index < num)
{
node = node.left;
}
else
{
index -= num + 1;
node = node.right;
}
}
throw new SystemException("Internal Error: index calculation");
}
}
// Token: 0x06000067 RID: 103 RVA: 0x000035E0 File Offset: 0x000017E0
public RBTree.NodeEnumerator GetEnumerator()
{
return new RBTree.NodeEnumerator(this);
}
// Token: 0x06000068 RID: 104 RVA: 0x000035E8 File Offset: 0x000017E8
private int find_key<T>(T key, List<RBTree.Node> path)
{
RBTree.INodeHelper<T> nodeHelper = (RBTree.INodeHelper<T>)this.hlp;
int num = 0;
RBTree.Node node = this.root;
if (path != null)
{
path.Add(this.root);
}
while (node != null)
{
num = nodeHelper.Compare(key, node);
if (num == 0)
{
return num;
}
RBTree.Node node2;
if (num < 0)
{
node2 = node.right;
node = node.left;
}
else
{
node2 = node.left;
node = node.right;
}
if (path != null)
{
path.Add(node2);
path.Add(node);
}
}
return num;
}
// Token: 0x06000069 RID: 105 RVA: 0x00003678 File Offset: 0x00001878
private RBTree.Node do_insert(int in_tree_cmp, RBTree.Node current, List<RBTree.Node> path)
{
path[path.Count - 1] = current;
RBTree.Node node = path[path.Count - 3];
if (in_tree_cmp < 0)
{
node.left = current;
}
else
{
node.right = current;
}
for (int i = 0; i < path.Count - 2; i += 2)
{
path[i].Size += 1U;
}
if (!node.IsBlack)
{
this.rebalance_insert(path);
}
if (!this.root.IsBlack)
{
throw new SystemException("Internal error: root is not black");
}
this.version += 1U;
return current;
}
// Token: 0x0600006A RID: 106 RVA: 0x00003728 File Offset: 0x00001928
private RBTree.Node do_remove(List<RBTree.Node> path)
{
int num = path.Count - 1;
RBTree.Node node = path[num];
if (node.left != null)
{
RBTree.Node node2 = RBTree.right_most(node.left, node.right, path);
node.SwapValue(node2);
if (node2.left != null)
{
RBTree.Node left = node2.left;
path.Add(null);
path.Add(left);
node2.SwapValue(left);
}
}
else if (node.right != null)
{
RBTree.Node right = node.right;
path.Add(null);
path.Add(right);
node.SwapValue(right);
}
num = path.Count - 1;
node = path[num];
if (node.Size != 1U)
{
throw new SystemException("Internal Error: red-black violation somewhere");
}
path[num] = null;
this.node_reparent((num != 0) ? path[num - 2] : null, node, 0U, null);
for (int i = 0; i < path.Count - 2; i += 2)
{
path[i].Size -= 1U;
}
if (num != 0 && node.IsBlack)
{
this.rebalance_delete(path);
}
if (this.root != null && !this.root.IsBlack)
{
throw new SystemException("Internal Error: root is not black");
}
this.version += 1U;
return node;
}
// Token: 0x0600006B RID: 107 RVA: 0x00003890 File Offset: 0x00001A90
private void rebalance_insert(List<RBTree.Node> path)
{
int num = path.Count - 1;
while (path[num - 3] != null && !path[num - 3].IsBlack)
{
RBTree.Node node = path[num - 2];
bool flag = true;
path[num - 3].IsBlack = flag;
node.IsBlack = flag;
num -= 4;
if (num == 0)
{
return;
}
path[num].IsBlack = false;
if (path[num - 2].IsBlack)
{
return;
}
}
this.rebalance_insert__rotate_final(num, path);
}
// Token: 0x0600006C RID: 108 RVA: 0x0000391C File Offset: 0x00001B1C
private void rebalance_delete(List<RBTree.Node> path)
{
int num = path.Count - 1;
for (;;)
{
RBTree.Node node = path[num - 1];
if (!node.IsBlack)
{
num = this.ensure_sibling_black(num, path);
node = path[num - 1];
}
if ((node.left != null && !node.left.IsBlack) || (node.right != null && !node.right.IsBlack))
{
break;
}
node.IsBlack = false;
num -= 2;
if (num == 0)
{
return;
}
if (!path[num].IsBlack)
{
goto Block_5;
}
}
this.rebalance_delete__rotate_final(num, path);
return;
Block_5:
path[num].IsBlack = true;
}
// Token: 0x0600006D RID: 109 RVA: 0x000039CC File Offset: 0x00001BCC
private void rebalance_insert__rotate_final(int curpos, List<RBTree.Node> path)
{
RBTree.Node node = path[curpos];
RBTree.Node node2 = path[curpos - 2];
RBTree.Node node3 = path[curpos - 4];
uint size = node3.Size;
bool flag = node2 == node3.left;
bool flag2 = node == node2.left;
RBTree.Node node4;
if (flag && flag2)
{
node3.left = node2.right;
node2.right = node3;
node4 = node2;
}
else if (flag && !flag2)
{
node3.left = node.right;
node.right = node3;
node2.right = node.left;
node.left = node2;
node4 = node;
}
else if (!flag && flag2)
{
node3.right = node.left;
node.left = node3;
node2.left = node.right;
node.right = node2;
node4 = node;
}
else
{
node3.right = node2.left;
node2.left = node3;
node4 = node2;
}
node3.FixSize();
node3.IsBlack = false;
if (node4 != node2)
{
node2.FixSize();
}
node4.IsBlack = true;
this.node_reparent((curpos != 4) ? path[curpos - 6] : null, node3, size, node4);
}
// Token: 0x0600006E RID: 110 RVA: 0x00003B10 File Offset: 0x00001D10
private void rebalance_delete__rotate_final(int curpos, List<RBTree.Node> path)
{
RBTree.Node node = path[curpos - 1];
RBTree.Node node2 = path[curpos - 2];
uint size = node2.Size;
bool isBlack = node2.IsBlack;
RBTree.Node node3;
if (node2.right == node)
{
if (node.right == null || node.right.IsBlack)
{
RBTree.Node left = node.left;
node2.right = left.left;
left.left = node2;
node.left = left.right;
left.right = node;
node3 = left;
}
else
{
node2.right = node.left;
node.left = node2;
node.right.IsBlack = true;
node3 = node;
}
}
else if (node.left == null || node.left.IsBlack)
{
RBTree.Node right = node.right;
node2.left = right.right;
right.right = node2;
node.right = right.left;
right.left = node;
node3 = right;
}
else
{
node2.left = node.right;
node.right = node2;
node.left.IsBlack = true;
node3 = node;
}
node2.FixSize();
node2.IsBlack = true;
if (node3 != node)
{
node.FixSize();
}
node3.IsBlack = isBlack;
this.node_reparent((curpos != 2) ? path[curpos - 4] : null, node2, size, node3);
}
// Token: 0x0600006F RID: 111 RVA: 0x00003C88 File Offset: 0x00001E88
private int ensure_sibling_black(int curpos, List<RBTree.Node> path)
{
RBTree.Node node = path[curpos];
RBTree.Node node2 = path[curpos - 1];
RBTree.Node node3 = path[curpos - 2];
uint size = node3.Size;
bool flag;
if (node3.right == node2)
{
node3.right = node2.left;
node2.left = node3;
flag = true;
}
else
{
node3.left = node2.right;
node2.right = node3;
flag = false;
}
node3.FixSize();
node3.IsBlack = false;
node2.IsBlack = true;
this.node_reparent((curpos != 2) ? path[curpos - 4] : null, node3, size, node2);
if (curpos + 1 == path.Count)
{
path.Add(null);
path.Add(null);
}
path[curpos - 2] = node2;
path[curpos - 1] = ((!flag) ? node2.left : node2.right);
path[curpos] = node3;
path[curpos + 1] = ((!flag) ? node3.left : node3.right);
path[curpos + 2] = node;
return curpos + 2;
}
// Token: 0x06000070 RID: 112 RVA: 0x00003DA4 File Offset: 0x00001FA4
private void node_reparent(RBTree.Node orig_parent, RBTree.Node orig, uint orig_size, RBTree.Node updated)
{
if (updated != null && updated.FixSize() != orig_size)
{
throw new SystemException("Internal error: rotation");
}
if (orig == this.root)
{
this.root = updated;
}
else if (orig == orig_parent.left)
{
orig_parent.left = updated;
}
else
{
if (orig != orig_parent.right)
{
throw new SystemException("Internal error: path error");
}
orig_parent.right = updated;
}
}
// Token: 0x06000071 RID: 113 RVA: 0x00003E28 File Offset: 0x00002028
private static RBTree.Node right_most(RBTree.Node current, RBTree.Node sibling, List<RBTree.Node> path)
{
for (;;)
{
path.Add(sibling);
path.Add(current);
if (current.right == null)
{
break;
}
sibling = current.left;
current = current.right;
}
return current;
}
// Token: 0x0400003D RID: 61
private RBTree.Node root;
// Token: 0x0400003E RID: 62
private object hlp;
// Token: 0x0400003F RID: 63
private uint version;
// Token: 0x04000040 RID: 64
[ThreadStatic]
private static List<RBTree.Node> cached_path;
// Token: 0x02000011 RID: 17
public interface INodeHelper<T>
{
// Token: 0x06000072 RID: 114
int Compare(T key, RBTree.Node node);
// Token: 0x06000073 RID: 115
RBTree.Node CreateNode(T key);
}
// Token: 0x02000012 RID: 18
public abstract class Node
{
// Token: 0x06000074 RID: 116 RVA: 0x00003E6C File Offset: 0x0000206C
public Node()
{
this.size_black = 2U;
}
// Token: 0x17000017 RID: 23
// (get) Token: 0x06000075 RID: 117 RVA: 0x00003E7C File Offset: 0x0000207C
// (set) Token: 0x06000076 RID: 118 RVA: 0x00003E8C File Offset: 0x0000208C
public bool IsBlack
{
get
{
return (this.size_black & 1U) == 1U;
}
set
{
this.size_black = ((!value) ? (this.size_black & 4294967294U) : (this.size_black | 1U));
}
}
// Token: 0x17000018 RID: 24
// (get) Token: 0x06000077 RID: 119 RVA: 0x00003EBC File Offset: 0x000020BC
// (set) Token: 0x06000078 RID: 120 RVA: 0x00003EC8 File Offset: 0x000020C8
public uint Size
{
get
{
return this.size_black >> 1;
}
set
{
this.size_black = (value << 1) | (this.size_black & 1U);
}
}
// Token: 0x06000079 RID: 121 RVA: 0x00003EDC File Offset: 0x000020DC
public uint FixSize()
{
this.Size = 1U;
if (this.left != null)
{
this.Size += this.left.Size;
}
if (this.right != null)
{
this.Size += this.right.Size;
}
return this.Size;
}
// Token: 0x0600007A RID: 122
public abstract void SwapValue(RBTree.Node other);
// Token: 0x04000041 RID: 65
private const uint black_mask = 1U;
// Token: 0x04000042 RID: 66
private const int black_shift = 1;
// Token: 0x04000043 RID: 67
public RBTree.Node left;
// Token: 0x04000044 RID: 68
public RBTree.Node right;
// Token: 0x04000045 RID: 69
private uint size_black;
}
// Token: 0x02000013 RID: 19
public struct NodeEnumerator : IEnumerator, IDisposable, IEnumerator<RBTree.Node>
{
// Token: 0x0600007B RID: 123 RVA: 0x00003F3C File Offset: 0x0000213C
internal NodeEnumerator(RBTree tree)
{
this.tree = tree;
this.version = tree.version;
this.pennants = null;
}
// Token: 0x17000019 RID: 25
// (get) Token: 0x0600007C RID: 124 RVA: 0x00003F58 File Offset: 0x00002158
object IEnumerator.Current
{
get
{
this.check_current();
return this.Current;
}
}
// Token: 0x0600007D RID: 125 RVA: 0x00003F68 File Offset: 0x00002168
public void Reset()
{
this.check_version();
this.pennants = null;
}
// Token: 0x1700001A RID: 26
// (get) Token: 0x0600007E RID: 126 RVA: 0x00003F78 File Offset: 0x00002178
public RBTree.Node Current
{
get
{
return this.pennants.Peek();
}
}
// Token: 0x0600007F RID: 127 RVA: 0x00003F88 File Offset: 0x00002188
public bool MoveNext()
{
this.check_version();
RBTree.Node node;
if (this.pennants == null)
{
if (this.tree.root == null)
{
return false;
}
this.pennants = new Stack<RBTree.Node>();
node = this.tree.root;
}
else
{
if (this.pennants.Count == 0)
{
return false;
}
RBTree.Node node2 = this.pennants.Pop();
node = node2.right;
}
while (node != null)
{
this.pennants.Push(node);
node = node.left;
}
return this.pennants.Count != 0;
}
// Token: 0x06000080 RID: 128 RVA: 0x00004028 File Offset: 0x00002228
public void Dispose()
{
this.tree = null;
this.pennants = null;
}
// Token: 0x06000081 RID: 129 RVA: 0x00004038 File Offset: 0x00002238
private void check_version()
{
if (this.tree == null)
{
throw new ObjectDisposedException("enumerator");
}
if (this.version != this.tree.version)
{
throw new InvalidOperationException("tree modified");
}
}
// Token: 0x06000082 RID: 130 RVA: 0x00004074 File Offset: 0x00002274
internal void check_current()
{
this.check_version();
if (this.pennants == null)
{
throw new InvalidOperationException("state invalid before the first MoveNext()");
}
}
// Token: 0x04000046 RID: 70
private RBTree tree;
// Token: 0x04000047 RID: 71
private uint version;
// Token: 0x04000048 RID: 72
private Stack<RBTree.Node> pennants;
}
}
}
@@ -0,0 +1,1234 @@
using System;
namespace System.Collections.Generic
{
/// <summary>Represents a collection of key/value pairs that are sorted on the key.</summary>
/// <typeparam name="TKey">The type of the keys in the dictionary.</typeparam>
/// <typeparam name="TValue">The type of the values in the dictionary.</typeparam>
/// <filterpriority>1</filterpriority>
// Token: 0x02000014 RID: 20
[Serializable]
public class SortedDictionary<TKey, TValue> : ICollection, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, IEnumerable, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>
{
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.SortedDictionary`2" /> class that is empty and uses the default <see cref="T:System.Collections.Generic.IComparer`1" /> implementation for the key type.</summary>
// Token: 0x06000083 RID: 131 RVA: 0x00004094 File Offset: 0x00002294
public SortedDictionary()
: this(null)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.SortedDictionary`2" /> class that is empty and uses the specified <see cref="T:System.Collections.Generic.IComparer`1" /> implementation to compare keys.</summary>
/// <param name="comparer">The <see cref="T:System.Collections.Generic.IComparer`1" /> implementation to use when comparing keys, or null to use the default <see cref="T:System.Collections.Generic.Comparer`1" /> for the type of the key.</param>
// Token: 0x06000084 RID: 132 RVA: 0x000040A0 File Offset: 0x000022A0
public SortedDictionary(IComparer<TKey> comparer)
{
this.hlp = SortedDictionary<TKey, TValue>.NodeHelper.GetHelper(comparer);
this.tree = new RBTree(this.hlp);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.SortedDictionary`2" /> class that contains elements copied from the specified <see cref="T:System.Collections.Generic.IDictionary`2" /> and uses the default <see cref="T:System.Collections.Generic.IComparer`1" /> implementation for the key type.</summary>
/// <param name="dictionary">The <see cref="T:System.Collections.Generic.IDictionary`2" /> whose elements are copied to the new <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="dictionary" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="dictionary" /> contains one or more duplicate keys.</exception>
// Token: 0x06000085 RID: 133 RVA: 0x000040C8 File Offset: 0x000022C8
public SortedDictionary(IDictionary<TKey, TValue> dic)
: this(dic, null)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.SortedDictionary`2" /> class that contains elements copied from the specified <see cref="T:System.Collections.Generic.IDictionary`2" /> and uses the specified <see cref="T:System.Collections.Generic.IComparer`1" /> implementation to compare keys.</summary>
/// <param name="dictionary">The <see cref="T:System.Collections.Generic.IDictionary`2" /> whose elements are copied to the new <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</param>
/// <param name="comparer">The <see cref="T:System.Collections.Generic.IComparer`1" /> implementation to use when comparing keys, or null to use the default <see cref="T:System.Collections.Generic.Comparer`1" /> for the type of the key.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="dictionary" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="dictionary" /> contains one or more duplicate keys.</exception>
// Token: 0x06000086 RID: 134 RVA: 0x000040D4 File Offset: 0x000022D4
public SortedDictionary(IDictionary<TKey, TValue> dic, IComparer<TKey> comparer)
: this(comparer)
{
if (dic == null)
{
throw new ArgumentNullException();
}
foreach (KeyValuePair<TKey, TValue> keyValuePair in dic)
{
this.Add(keyValuePair.Key, keyValuePair.Value);
}
}
// Token: 0x1700001B RID: 27
// (get) Token: 0x06000087 RID: 135 RVA: 0x00004154 File Offset: 0x00002354
ICollection<TKey> IDictionary<TKey, TValue>.Keys
{
get
{
return new SortedDictionary<TKey, TValue>.KeyCollection(this);
}
}
// Token: 0x1700001C RID: 28
// (get) Token: 0x06000088 RID: 136 RVA: 0x0000415C File Offset: 0x0000235C
ICollection<TValue> IDictionary<TKey, TValue>.Values
{
get
{
return new SortedDictionary<TKey, TValue>.ValueCollection(this);
}
}
// Token: 0x06000089 RID: 137 RVA: 0x00004164 File Offset: 0x00002364
void ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue> item)
{
this.Add(item.Key, item.Value);
}
// Token: 0x0600008A RID: 138 RVA: 0x0000417C File Offset: 0x0000237C
bool ICollection<KeyValuePair<TKey, TValue>>.Contains(KeyValuePair<TKey, TValue> item)
{
TValue tvalue;
return this.TryGetValue(item.Key, out tvalue) && EqualityComparer<TValue>.Default.Equals(item.Value, tvalue);
}
// Token: 0x1700001D RID: 29
// (get) Token: 0x0600008B RID: 139 RVA: 0x000041B4 File Offset: 0x000023B4
bool ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly
{
get
{
return false;
}
}
// Token: 0x0600008C RID: 140 RVA: 0x000041B8 File Offset: 0x000023B8
bool ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue> item)
{
TValue tvalue;
return this.TryGetValue(item.Key, out tvalue) && EqualityComparer<TValue>.Default.Equals(item.Value, tvalue) && this.Remove(item.Key);
}
/// <summary>Adds an element with the provided key and value to the <see cref="T:System.Collections.IDictionary" />.</summary>
/// <param name="key">The object to use as the key of the element to add.</param>
/// <param name="value">The object to use as the value of the element to add.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="key" /> is of a type that is not assignable to the key type <paramref name="TKey" /> of the <see cref="T:System.Collections.IDictionary" />.-or-<paramref name="value" /> is of a type that is not assignable to the value type <paramref name="TValue" /> of the <see cref="T:System.Collections.IDictionary" />.-or-An element with the same key already exists in the <see cref="T:System.Collections.IDictionary" />.</exception>
// Token: 0x0600008D RID: 141 RVA: 0x00004200 File Offset: 0x00002400
void IDictionary.Add(object key, object value)
{
this.Add(this.ToKey(key), this.ToValue(value));
}
/// <summary>Determines whether the <see cref="T:System.Collections.IDictionary" /> contains an element with the specified key.</summary>
/// <returns>true if the <see cref="T:System.Collections.IDictionary" /> contains an element with the key; otherwise, false.</returns>
/// <param name="key">The key to locate in the <see cref="T:System.Collections.IDictionary" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x0600008E RID: 142 RVA: 0x00004218 File Offset: 0x00002418
bool IDictionary.Contains(object key)
{
return this.ContainsKey(this.ToKey(key));
}
/// <summary>Returns an <see cref="T:System.Collections.IDictionaryEnumerator" /> for the <see cref="T:System.Collections.IDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.IDictionaryEnumerator" /> for the <see cref="T:System.Collections.IDictionary" />.</returns>
// Token: 0x0600008F RID: 143 RVA: 0x00004228 File Offset: 0x00002428
IDictionaryEnumerator IDictionary.GetEnumerator()
{
return new SortedDictionary<TKey, TValue>.Enumerator(this);
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.IDictionary" /> has a fixed size.</summary>
/// <returns>true if the <see cref="T:System.Collections.IDictionary" /> has a fixed size; otherwise, false. In the default implementation of <see cref="T:System.Collections.Generic.SortedDictionary`2" />, this property always returns false.</returns>
// Token: 0x1700001E RID: 30
// (get) Token: 0x06000090 RID: 144 RVA: 0x00004238 File Offset: 0x00002438
bool IDictionary.IsFixedSize
{
get
{
return false;
}
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.IDictionary" /> is read-only.</summary>
/// <returns>true if the <see cref="T:System.Collections.IDictionary" /> is read-only; otherwise, false. In the default implementation of <see cref="T:System.Collections.Generic.SortedDictionary`2" />, this property always returns false.</returns>
// Token: 0x1700001F RID: 31
// (get) Token: 0x06000091 RID: 145 RVA: 0x0000423C File Offset: 0x0000243C
bool IDictionary.IsReadOnly
{
get
{
return false;
}
}
/// <summary>Gets an <see cref="T:System.Collections.ICollection" /> containing the keys of the <see cref="T:System.Collections.IDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.ICollection" /> containing the keys of the <see cref="T:System.Collections.IDictionary" />.</returns>
// Token: 0x17000020 RID: 32
// (get) Token: 0x06000092 RID: 146 RVA: 0x00004240 File Offset: 0x00002440
ICollection IDictionary.Keys
{
get
{
return new SortedDictionary<TKey, TValue>.KeyCollection(this);
}
}
/// <summary>Removes the element with the specified key from the <see cref="T:System.Collections.IDictionary" />.</summary>
/// <param name="key">The key of the element to remove.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x06000093 RID: 147 RVA: 0x00004248 File Offset: 0x00002448
void IDictionary.Remove(object key)
{
this.Remove(this.ToKey(key));
}
/// <summary>Gets an <see cref="T:System.Collections.ICollection" /> containing the values in the <see cref="T:System.Collections.IDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.ICollection" /> containing the values in the <see cref="T:System.Collections.IDictionary" />.</returns>
// Token: 0x17000021 RID: 33
// (get) Token: 0x06000094 RID: 148 RVA: 0x00004258 File Offset: 0x00002458
ICollection IDictionary.Values
{
get
{
return new SortedDictionary<TKey, TValue>.ValueCollection(this);
}
}
/// <summary>Gets or sets the element with the specified key.</summary>
/// <returns>The element with the specified key, or null if <paramref name="key" /> is not in the dictionary or <paramref name="key" /> is of a type that is not assignable to the key type <paramref name="TKey" /> of the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</returns>
/// <param name="key">The key of the element to get.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">A value is being assigned, and <paramref name="key" /> is of a type that is not assignable to the key type <paramref name="TKey" /> of the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.-or-A value is being assigned, and <paramref name="value" /> is of a type that is not assignable to the value type <paramref name="TValue" /> of the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</exception>
// Token: 0x17000022 RID: 34
object IDictionary.this[object key]
{
get
{
return this[this.ToKey(key)];
}
set
{
this[this.ToKey(key)] = this.ToValue(value);
}
}
/// <summary>Copies the elements of the <see cref="T:System.Collections.Generic.ICollection`1" /> to an array, starting at the specified array index.</summary>
/// <param name="array">The one-dimensional array that is the destination of the elements copied from the <see cref="T:System.Collections.Generic.ICollection`1" />. The array must have zero-based indexing.</param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than 0.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or-<paramref name="array" /> does not have zero-based indexing.-or-The number of elements in the source <see cref="T:System.Collections.Generic.ICollection`1" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.-or-The type of the source <see cref="T:System.Collections.Generic.ICollection`1" /> cannot be cast automatically to the type of the destination <paramref name="array" />.</exception>
// Token: 0x06000097 RID: 151 RVA: 0x0000428C File Offset: 0x0000248C
void ICollection.CopyTo(Array array, int index)
{
if (this.Count == 0)
{
return;
}
if (array == null)
{
throw new ArgumentNullException();
}
if (index < 0 || array.Length <= index)
{
throw new ArgumentOutOfRangeException();
}
if (array.Length - index < this.Count)
{
throw new ArgumentException();
}
foreach (RBTree.Node node in this.tree)
{
SortedDictionary<TKey, TValue>.Node node2 = (SortedDictionary<TKey, TValue>.Node)node;
array.SetValue(node2.AsDE(), index++);
}
}
/// <summary>Gets a value indicating whether access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe).</summary>
/// <returns>true if access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe); otherwise, false. In the default implementation of <see cref="T:System.Collections.Generic.SortedDictionary`2" />, this property always returns false.</returns>
// Token: 0x17000023 RID: 35
// (get) Token: 0x06000098 RID: 152 RVA: 0x00004354 File Offset: 0x00002554
bool ICollection.IsSynchronized
{
get
{
return false;
}
}
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />.</summary>
/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />. </returns>
// Token: 0x17000024 RID: 36
// (get) Token: 0x06000099 RID: 153 RVA: 0x00004358 File Offset: 0x00002558
object ICollection.SyncRoot
{
get
{
return this;
}
}
/// <summary>Returns an enumerator that iterates through the collection.</summary>
/// <returns>An <see cref="T:System.Collections.Generic.IEnumerator`1" /> that can be used to iterate through the collection.</returns>
// Token: 0x0600009A RID: 154 RVA: 0x0000435C File Offset: 0x0000255C
IEnumerator IEnumerable.GetEnumerator()
{
return new SortedDictionary<TKey, TValue>.Enumerator(this);
}
// Token: 0x0600009B RID: 155 RVA: 0x0000436C File Offset: 0x0000256C
IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()
{
return new SortedDictionary<TKey, TValue>.Enumerator(this);
}
/// <summary>Gets the <see cref="T:System.Collections.Generic.IComparer`1" /> used to order the elements of the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</summary>
/// <returns>The <see cref="T:System.Collections.Generic.IComparer`1" /> used to order the elements of the <see cref="T:System.Collections.Generic.SortedDictionary`2" /></returns>
// Token: 0x17000025 RID: 37
// (get) Token: 0x0600009C RID: 156 RVA: 0x0000437C File Offset: 0x0000257C
public IComparer<TKey> Comparer
{
get
{
return this.hlp.cmp;
}
}
/// <summary>Gets the number of key/value pairs contained in the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</summary>
/// <returns>The number of key/value pairs contained in the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</returns>
// Token: 0x17000026 RID: 38
// (get) Token: 0x0600009D RID: 157 RVA: 0x0000438C File Offset: 0x0000258C
public int Count
{
get
{
return this.tree.Count;
}
}
/// <summary>Gets or sets the value associated with the specified key.</summary>
/// <returns>The value associated with the specified key. If the specified key is not found, a get operation throws a <see cref="T:System.Collections.Generic.KeyNotFoundException" />, and a set operation creates a new element with the specified key.</returns>
/// <param name="key">The key of the value to get or set.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
/// <exception cref="T:System.Collections.Generic.KeyNotFoundException">The property is retrieved and <paramref name="key" /> does not exist in the collection.</exception>
// Token: 0x17000027 RID: 39
public TValue this[TKey key]
{
get
{
SortedDictionary<TKey, TValue>.Node node = (SortedDictionary<TKey, TValue>.Node)this.tree.Lookup<TKey>(key);
if (node == null)
{
throw new KeyNotFoundException();
}
return node.value;
}
set
{
if (key == null)
{
throw new ArgumentNullException("key");
}
SortedDictionary<TKey, TValue>.Node node = (SortedDictionary<TKey, TValue>.Node)this.tree.Intern<TKey>(key, null);
node.value = value;
}
}
/// <summary>Gets a collection containing the keys in the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</summary>
/// <returns>A <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection" /> containing the keys in the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</returns>
// Token: 0x17000028 RID: 40
// (get) Token: 0x060000A0 RID: 160 RVA: 0x00004410 File Offset: 0x00002610
public SortedDictionary<TKey, TValue>.KeyCollection Keys
{
get
{
return new SortedDictionary<TKey, TValue>.KeyCollection(this);
}
}
/// <summary>Gets a collection containing the values in the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</summary>
/// <returns>A <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection" /> containing the values in the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</returns>
// Token: 0x17000029 RID: 41
// (get) Token: 0x060000A1 RID: 161 RVA: 0x00004418 File Offset: 0x00002618
public SortedDictionary<TKey, TValue>.ValueCollection Values
{
get
{
return new SortedDictionary<TKey, TValue>.ValueCollection(this);
}
}
/// <summary>Adds an element with the specified key and value into the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</summary>
/// <param name="key">The key of the element to add.</param>
/// <param name="value">The value of the element to add. The value can be null for reference types.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">An element with the same key already exists in the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</exception>
// Token: 0x060000A2 RID: 162 RVA: 0x00004420 File Offset: 0x00002620
public void Add(TKey key, TValue value)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
RBTree.Node node = new SortedDictionary<TKey, TValue>.Node(key, value);
if (this.tree.Intern<TKey>(key, node) != node)
{
throw new ArgumentException("key already present in dictionary", "key");
}
}
/// <summary>Removes all elements from the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</summary>
// Token: 0x060000A3 RID: 163 RVA: 0x00004470 File Offset: 0x00002670
public void Clear()
{
this.tree.Clear();
}
/// <summary>Determines whether the <see cref="T:System.Collections.Generic.SortedDictionary`2" /> contains an element with the specified key.</summary>
/// <returns>true if the <see cref="T:System.Collections.Generic.SortedDictionary`2" /> contains an element with the specified key; otherwise, false.</returns>
/// <param name="key">The key to locate in the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x060000A4 RID: 164 RVA: 0x00004480 File Offset: 0x00002680
public bool ContainsKey(TKey key)
{
return this.tree.Lookup<TKey>(key) != null;
}
/// <summary>Determines whether the <see cref="T:System.Collections.Generic.SortedDictionary`2" /> contains an element with the specified value.</summary>
/// <returns>true if the <see cref="T:System.Collections.Generic.SortedDictionary`2" /> contains an element with the specified value; otherwise, false.</returns>
/// <param name="value">The value to locate in the <see cref="T:System.Collections.Generic.SortedDictionary`2" />. The value can be null for reference types.</param>
// Token: 0x060000A5 RID: 165 RVA: 0x00004494 File Offset: 0x00002694
public bool ContainsValue(TValue value)
{
IEqualityComparer<TValue> @default = EqualityComparer<TValue>.Default;
foreach (RBTree.Node node in this.tree)
{
SortedDictionary<TKey, TValue>.Node node2 = (SortedDictionary<TKey, TValue>.Node)node;
if (@default.Equals(value, node2.value))
{
return true;
}
}
return false;
}
/// <summary>Copies the elements of the <see cref="T:System.Collections.Generic.SortedDictionary`2" /> to the specified array of <see cref="T:System.Collections.Generic.KeyValuePair`2" /> structures, starting at the specified index.</summary>
/// <param name="array">The one-dimensional array of <see cref="T:System.Collections.Generic.KeyValuePair`2" /> structures that is the destination of the elements copied from the current <see cref="T:System.Collections.Generic.SortedDictionary`2" /> The array must have zero-based indexing.</param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than 0.</exception>
/// <exception cref="T:System.ArgumentException">The number of elements in the source <see cref="T:System.Collections.Generic.SortedDictionary`2" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.</exception>
// Token: 0x060000A6 RID: 166 RVA: 0x0000451C File Offset: 0x0000271C
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
{
if (this.Count == 0)
{
return;
}
if (array == null)
{
throw new ArgumentNullException();
}
if (arrayIndex < 0 || array.Length <= arrayIndex)
{
throw new ArgumentOutOfRangeException();
}
if (array.Length - arrayIndex < this.Count)
{
throw new ArgumentException();
}
foreach (RBTree.Node node in this.tree)
{
SortedDictionary<TKey, TValue>.Node node2 = (SortedDictionary<TKey, TValue>.Node)node;
array[arrayIndex++] = node2.AsKV();
}
}
/// <summary>Returns an enumerator that iterates through the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</summary>
/// <returns>A <see cref="T:System.Collections.Generic.SortedDictionary`2.Enumerator" /> for the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</returns>
// Token: 0x060000A7 RID: 167 RVA: 0x000045DC File Offset: 0x000027DC
public SortedDictionary<TKey, TValue>.Enumerator GetEnumerator()
{
return new SortedDictionary<TKey, TValue>.Enumerator(this);
}
/// <summary>Removes the element with the specified key from the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</summary>
/// <returns>true if the element is successfully removed; otherwise, false. This method also returns false if <paramref name="key" /> is not found in the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</returns>
/// <param name="key">The key of the element to remove.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x060000A8 RID: 168 RVA: 0x000045E4 File Offset: 0x000027E4
public bool Remove(TKey key)
{
return this.tree.Remove<TKey>(key) != null;
}
/// <summary>Gets the value associated with the specified key.</summary>
/// <returns>true if the <see cref="T:System.Collections.Generic.SortedDictionary`2" /> contains an element with the specified key; otherwise, false.</returns>
/// <param name="key">The key of the value to get.</param>
/// <param name="value">When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the <paramref name="value" /> parameter. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x060000A9 RID: 169 RVA: 0x000045F8 File Offset: 0x000027F8
public bool TryGetValue(TKey key, out TValue value)
{
SortedDictionary<TKey, TValue>.Node node = (SortedDictionary<TKey, TValue>.Node)this.tree.Lookup<TKey>(key);
value = ((node != null) ? node.value : default(TValue));
return node != null;
}
// Token: 0x060000AA RID: 170 RVA: 0x00004640 File Offset: 0x00002840
private TKey ToKey(object key)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
if (!(key is TKey))
{
throw new ArgumentException(string.Format("Key \"{0}\" cannot be converted to the key type {1}.", key, typeof(TKey)));
}
return (TKey)((object)key);
}
// Token: 0x060000AB RID: 171 RVA: 0x00004680 File Offset: 0x00002880
private TValue ToValue(object value)
{
if (!(value is TValue) && (value != null || typeof(TValue).IsValueType))
{
throw new ArgumentException(string.Format("Value \"{0}\" cannot be converted to the value type {1}.", value, typeof(TValue)));
}
return (TValue)((object)value);
}
// Token: 0x04000049 RID: 73
private RBTree tree;
// Token: 0x0400004A RID: 74
private SortedDictionary<TKey, TValue>.NodeHelper hlp;
// Token: 0x02000015 RID: 21
private class Node : RBTree.Node
{
// Token: 0x060000AC RID: 172 RVA: 0x000046D4 File Offset: 0x000028D4
public Node(TKey key)
{
this.key = key;
}
// Token: 0x060000AD RID: 173 RVA: 0x000046E4 File Offset: 0x000028E4
public Node(TKey key, TValue value)
{
this.key = key;
this.value = value;
}
// Token: 0x060000AE RID: 174 RVA: 0x000046FC File Offset: 0x000028FC
public override void SwapValue(RBTree.Node other)
{
SortedDictionary<TKey, TValue>.Node node = (SortedDictionary<TKey, TValue>.Node)other;
TKey tkey = this.key;
this.key = node.key;
node.key = tkey;
TValue tvalue = this.value;
this.value = node.value;
node.value = tvalue;
}
// Token: 0x060000AF RID: 175 RVA: 0x00004744 File Offset: 0x00002944
public KeyValuePair<TKey, TValue> AsKV()
{
return new KeyValuePair<TKey, TValue>(this.key, this.value);
}
// Token: 0x060000B0 RID: 176 RVA: 0x00004758 File Offset: 0x00002958
public DictionaryEntry AsDE()
{
return new DictionaryEntry(this.key, this.value);
}
// Token: 0x0400004B RID: 75
public TKey key;
// Token: 0x0400004C RID: 76
public TValue value;
}
// Token: 0x02000016 RID: 22
private class NodeHelper : RBTree.INodeHelper<TKey>
{
// Token: 0x060000B1 RID: 177 RVA: 0x00004778 File Offset: 0x00002978
private NodeHelper(IComparer<TKey> cmp)
{
this.cmp = cmp;
}
// Token: 0x060000B3 RID: 179 RVA: 0x0000479C File Offset: 0x0000299C
public int Compare(TKey key, RBTree.Node node)
{
return this.cmp.Compare(key, ((SortedDictionary<TKey, TValue>.Node)node).key);
}
// Token: 0x060000B4 RID: 180 RVA: 0x000047B8 File Offset: 0x000029B8
public RBTree.Node CreateNode(TKey key)
{
return new SortedDictionary<TKey, TValue>.Node(key);
}
// Token: 0x060000B5 RID: 181 RVA: 0x000047C0 File Offset: 0x000029C0
public static SortedDictionary<TKey, TValue>.NodeHelper GetHelper(IComparer<TKey> cmp)
{
if (cmp == null || cmp == Comparer<TKey>.Default)
{
return SortedDictionary<TKey, TValue>.NodeHelper.Default;
}
return new SortedDictionary<TKey, TValue>.NodeHelper(cmp);
}
// Token: 0x0400004D RID: 77
public IComparer<TKey> cmp;
// Token: 0x0400004E RID: 78
private static SortedDictionary<TKey, TValue>.NodeHelper Default = new SortedDictionary<TKey, TValue>.NodeHelper(Comparer<TKey>.Default);
}
/// <summary>Represents the collection of values in a <see cref="T:System.Collections.Generic.SortedDictionary`2" />. This class cannot be inherited.</summary>
// Token: 0x02000017 RID: 23
[Serializable]
public sealed class ValueCollection : ICollection, IEnumerable, ICollection<TValue>, IEnumerable<TValue>
{
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection" /> class that reflects the values in the specified <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</summary>
/// <param name="dictionary">The <see cref="T:System.Collections.Generic.SortedDictionary`2" /> whose values are reflected in the new <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="dictionary" /> is null.</exception>
// Token: 0x060000B6 RID: 182 RVA: 0x000047E0 File Offset: 0x000029E0
public ValueCollection(SortedDictionary<TKey, TValue> dic)
{
this._dic = dic;
}
// Token: 0x060000B7 RID: 183 RVA: 0x000047F0 File Offset: 0x000029F0
void ICollection<TValue>.Add(TValue item)
{
throw new NotSupportedException();
}
// Token: 0x060000B8 RID: 184 RVA: 0x000047F8 File Offset: 0x000029F8
void ICollection<TValue>.Clear()
{
throw new NotSupportedException();
}
// Token: 0x060000B9 RID: 185 RVA: 0x00004800 File Offset: 0x00002A00
bool ICollection<TValue>.Contains(TValue item)
{
return this._dic.ContainsValue(item);
}
// Token: 0x1700002A RID: 42
// (get) Token: 0x060000BA RID: 186 RVA: 0x00004810 File Offset: 0x00002A10
bool ICollection<TValue>.IsReadOnly
{
get
{
return true;
}
}
// Token: 0x060000BB RID: 187 RVA: 0x00004814 File Offset: 0x00002A14
bool ICollection<TValue>.Remove(TValue item)
{
throw new NotSupportedException();
}
// Token: 0x060000BC RID: 188 RVA: 0x0000481C File Offset: 0x00002A1C
IEnumerator<TValue> IEnumerable<TValue>.GetEnumerator()
{
return this.GetEnumerator();
}
/// <summary>Copies the elements of the <see cref="T:System.Collections.ICollection" /> to an array, starting at a particular array index.</summary>
/// <param name="array">The one-dimensional array that is the destination of the elements copied from the <see cref="T:System.Collections.ICollection" />. The array must have zero-based indexing.</param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than 0.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or-<paramref name="array" /> does not have zero-based indexing.-or-The number of elements in the source <see cref="T:System.Collections.ICollection" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.-or-The type of the source <see cref="T:System.Collections.ICollection" /> cannot be cast automatically to the type of the destination <paramref name="array" />.</exception>
// Token: 0x060000BD RID: 189 RVA: 0x0000482C File Offset: 0x00002A2C
void ICollection.CopyTo(Array array, int index)
{
if (this.Count == 0)
{
return;
}
if (array == null)
{
throw new ArgumentNullException();
}
if (index < 0 || array.Length <= index)
{
throw new ArgumentOutOfRangeException();
}
if (array.Length - index < this.Count)
{
throw new ArgumentException();
}
foreach (RBTree.Node node in this._dic.tree)
{
SortedDictionary<TKey, TValue>.Node node2 = (SortedDictionary<TKey, TValue>.Node)node;
array.SetValue(node2.value, index++);
}
}
/// <summary>Gets a value indicating whether access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe).</summary>
/// <returns>true if access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe); otherwise, false. In the default implementation of <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection" />, this property always returns false.</returns>
// Token: 0x1700002B RID: 43
// (get) Token: 0x060000BE RID: 190 RVA: 0x000048F8 File Offset: 0x00002AF8
bool ICollection.IsSynchronized
{
get
{
return false;
}
}
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />.</summary>
/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />. In the default implementation of <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection" />, this property always returns the current instance.</returns>
// Token: 0x1700002C RID: 44
// (get) Token: 0x060000BF RID: 191 RVA: 0x000048FC File Offset: 0x00002AFC
object ICollection.SyncRoot
{
get
{
return this._dic;
}
}
/// <summary>Returns an enumerator that iterates through the collection.</summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> that can be used to iterate through the collection.</returns>
// Token: 0x060000C0 RID: 192 RVA: 0x00004904 File Offset: 0x00002B04
IEnumerator IEnumerable.GetEnumerator()
{
return new SortedDictionary<TKey, TValue>.ValueCollection.Enumerator(this._dic);
}
/// <summary>Copies the <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection" /> elements to an existing one-dimensional array, starting at the specified array index.</summary>
/// <param name="array">The one-dimensional array that is the destination of the elements copied from the <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection" />. The array must have zero-based indexing.</param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than 0.</exception>
/// <exception cref="T:System.ArgumentException">The number of elements in the source <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.</exception>
// Token: 0x060000C1 RID: 193 RVA: 0x00004918 File Offset: 0x00002B18
public void CopyTo(TValue[] array, int arrayIndex)
{
if (this.Count == 0)
{
return;
}
if (array == null)
{
throw new ArgumentNullException();
}
if (arrayIndex < 0 || array.Length <= arrayIndex)
{
throw new ArgumentOutOfRangeException();
}
if (array.Length - arrayIndex < this.Count)
{
throw new ArgumentException();
}
foreach (RBTree.Node node in this._dic.tree)
{
SortedDictionary<TKey, TValue>.Node node2 = (SortedDictionary<TKey, TValue>.Node)node;
array[arrayIndex++] = node2.value;
}
}
/// <summary>Gets the number of elements contained in the <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection" />.</summary>
/// <returns>The number of elements contained in the <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection" />.</returns>
// Token: 0x1700002D RID: 45
// (get) Token: 0x060000C2 RID: 194 RVA: 0x000049D8 File Offset: 0x00002BD8
public int Count
{
get
{
return this._dic.Count;
}
}
/// <summary>Returns an enumerator that iterates through the <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection" />.</summary>
/// <returns>A <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection.Enumerator" /> structure for the <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection" />.</returns>
// Token: 0x060000C3 RID: 195 RVA: 0x000049E8 File Offset: 0x00002BE8
public SortedDictionary<TKey, TValue>.ValueCollection.Enumerator GetEnumerator()
{
return new SortedDictionary<TKey, TValue>.ValueCollection.Enumerator(this._dic);
}
// Token: 0x0400004F RID: 79
private SortedDictionary<TKey, TValue> _dic;
/// <summary>Enumerates the elements of a <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection" />.</summary>
// Token: 0x02000018 RID: 24
public struct Enumerator : IEnumerator, IDisposable, IEnumerator<TValue>
{
// Token: 0x060000C4 RID: 196 RVA: 0x000049F8 File Offset: 0x00002BF8
internal Enumerator(SortedDictionary<TKey, TValue> dic)
{
this.host = dic.tree.GetEnumerator();
}
/// <summary>Gets the element at the current position of the enumerator.</summary>
/// <returns>The element in the collection at the current position of the enumerator.</returns>
/// <exception cref="T:System.InvalidOperationException">The enumerator is positioned before the first element of the collection or after the last element. </exception>
// Token: 0x1700002E RID: 46
// (get) Token: 0x060000C5 RID: 197 RVA: 0x00004A0C File Offset: 0x00002C0C
object IEnumerator.Current
{
get
{
this.host.check_current();
return this.current;
}
}
/// <summary>Sets the enumerator to its initial position, which is before the first element in the collection.</summary>
/// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
// Token: 0x060000C6 RID: 198 RVA: 0x00004A24 File Offset: 0x00002C24
void IEnumerator.Reset()
{
this.host.Reset();
}
/// <summary>Gets the element at the current position of the enumerator.</summary>
/// <returns>The element in the <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection" /> at the current position of the enumerator.</returns>
// Token: 0x1700002F RID: 47
// (get) Token: 0x060000C7 RID: 199 RVA: 0x00004A34 File Offset: 0x00002C34
public TValue Current
{
get
{
return this.current;
}
}
/// <summary>Advances the enumerator to the next element of the <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection" />.</summary>
/// <returns>true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.</returns>
/// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
// Token: 0x060000C8 RID: 200 RVA: 0x00004A3C File Offset: 0x00002C3C
public bool MoveNext()
{
if (!this.host.MoveNext())
{
return false;
}
this.current = ((SortedDictionary<TKey, TValue>.Node)this.host.Current).value;
return true;
}
/// <summary>Releases all resources used by the <see cref="T:System.Collections.Generic.SortedDictionary`2.ValueCollection.Enumerator" />.</summary>
// Token: 0x060000C9 RID: 201 RVA: 0x00004A78 File Offset: 0x00002C78
public void Dispose()
{
this.host.Dispose();
}
// Token: 0x04000050 RID: 80
private RBTree.NodeEnumerator host;
// Token: 0x04000051 RID: 81
private TValue current;
}
}
/// <summary>Represents the collection of keys in a <see cref="T:System.Collections.Generic.SortedDictionary`2" />. This class cannot be inherited. </summary>
// Token: 0x02000019 RID: 25
[Serializable]
public sealed class KeyCollection : ICollection, IEnumerable, ICollection<TKey>, IEnumerable<TKey>
{
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection" /> class that reflects the keys in the specified <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</summary>
/// <param name="dictionary">The <see cref="T:System.Collections.Generic.SortedDictionary`2" /> whose keys are reflected in the new <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="dictionary" /> is null.</exception>
// Token: 0x060000CA RID: 202 RVA: 0x00004A88 File Offset: 0x00002C88
public KeyCollection(SortedDictionary<TKey, TValue> dic)
{
this._dic = dic;
}
// Token: 0x060000CB RID: 203 RVA: 0x00004A98 File Offset: 0x00002C98
void ICollection<TKey>.Add(TKey item)
{
throw new NotSupportedException();
}
// Token: 0x060000CC RID: 204 RVA: 0x00004AA0 File Offset: 0x00002CA0
void ICollection<TKey>.Clear()
{
throw new NotSupportedException();
}
// Token: 0x060000CD RID: 205 RVA: 0x00004AA8 File Offset: 0x00002CA8
bool ICollection<TKey>.Contains(TKey item)
{
return this._dic.ContainsKey(item);
}
// Token: 0x060000CE RID: 206 RVA: 0x00004AB8 File Offset: 0x00002CB8
IEnumerator<TKey> IEnumerable<TKey>.GetEnumerator()
{
return this.GetEnumerator();
}
// Token: 0x17000030 RID: 48
// (get) Token: 0x060000CF RID: 207 RVA: 0x00004AC8 File Offset: 0x00002CC8
bool ICollection<TKey>.IsReadOnly
{
get
{
return true;
}
}
// Token: 0x060000D0 RID: 208 RVA: 0x00004ACC File Offset: 0x00002CCC
bool ICollection<TKey>.Remove(TKey item)
{
throw new NotSupportedException();
}
/// <summary>Copies the elements of the <see cref="T:System.Collections.ICollection" /> to an array, starting at a particular array index.</summary>
/// <param name="array">The one-dimensional array that is the destination of the elements copied from the <see cref="T:System.Collections.ICollection" />. The array must have zero-based indexing.</param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than 0.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or-<paramref name="array" /> does not have zero-based indexing.-or-The number of elements in the source <see cref="T:System.Collections.ICollection" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.-or-The type of the source <see cref="T:System.Collections.ICollection" /> cannot be cast automatically to the type of the destination <paramref name="array" />.</exception>
// Token: 0x060000D1 RID: 209 RVA: 0x00004AD4 File Offset: 0x00002CD4
void ICollection.CopyTo(Array array, int index)
{
if (this.Count == 0)
{
return;
}
if (array == null)
{
throw new ArgumentNullException();
}
if (index < 0 || array.Length <= index)
{
throw new ArgumentOutOfRangeException();
}
if (array.Length - index < this.Count)
{
throw new ArgumentException();
}
foreach (RBTree.Node node in this._dic.tree)
{
SortedDictionary<TKey, TValue>.Node node2 = (SortedDictionary<TKey, TValue>.Node)node;
array.SetValue(node2.key, index++);
}
}
/// <summary>Gets a value indicating whether access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe).</summary>
/// <returns>true if access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe); otherwise, false. In the default implementation of <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection" />, this property always returns false.</returns>
// Token: 0x17000031 RID: 49
// (get) Token: 0x060000D2 RID: 210 RVA: 0x00004BA0 File Offset: 0x00002DA0
bool ICollection.IsSynchronized
{
get
{
return false;
}
}
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />.</summary>
/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />. In the default implementation of <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection" />, this property always returns the current instance.</returns>
// Token: 0x17000032 RID: 50
// (get) Token: 0x060000D3 RID: 211 RVA: 0x00004BA4 File Offset: 0x00002DA4
object ICollection.SyncRoot
{
get
{
return this._dic;
}
}
/// <summary>Returns an enumerator that iterates through the collection.</summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> that can be used to iterate through the collection.</returns>
// Token: 0x060000D4 RID: 212 RVA: 0x00004BAC File Offset: 0x00002DAC
IEnumerator IEnumerable.GetEnumerator()
{
return new SortedDictionary<TKey, TValue>.KeyCollection.Enumerator(this._dic);
}
/// <summary>Copies the <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection" /> elements to an existing one-dimensional array, starting at the specified array index.</summary>
/// <param name="array">The one-dimensional array that is the destination of the elements copied from the <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection" />. The array must have zero-based indexing.</param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than 0.</exception>
/// <exception cref="T:System.ArgumentException">The number of elements in the source <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.</exception>
// Token: 0x060000D5 RID: 213 RVA: 0x00004BC0 File Offset: 0x00002DC0
public void CopyTo(TKey[] array, int arrayIndex)
{
if (this.Count == 0)
{
return;
}
if (array == null)
{
throw new ArgumentNullException();
}
if (arrayIndex < 0 || array.Length <= arrayIndex)
{
throw new ArgumentOutOfRangeException();
}
if (array.Length - arrayIndex < this.Count)
{
throw new ArgumentException();
}
foreach (RBTree.Node node in this._dic.tree)
{
SortedDictionary<TKey, TValue>.Node node2 = (SortedDictionary<TKey, TValue>.Node)node;
array[arrayIndex++] = node2.key;
}
}
/// <summary>Gets the number of elements contained in the <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection" />.</summary>
/// <returns>The number of elements contained in the <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection" />.</returns>
// Token: 0x17000033 RID: 51
// (get) Token: 0x060000D6 RID: 214 RVA: 0x00004C80 File Offset: 0x00002E80
public int Count
{
get
{
return this._dic.Count;
}
}
/// <summary>Returns an enumerator that iterates through the <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection" />.</summary>
/// <returns>A <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection.Enumerator" /> structure for the <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection" />.</returns>
// Token: 0x060000D7 RID: 215 RVA: 0x00004C90 File Offset: 0x00002E90
public SortedDictionary<TKey, TValue>.KeyCollection.Enumerator GetEnumerator()
{
return new SortedDictionary<TKey, TValue>.KeyCollection.Enumerator(this._dic);
}
// Token: 0x04000052 RID: 82
private SortedDictionary<TKey, TValue> _dic;
/// <summary>Enumerates the elements of a <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection" />.</summary>
// Token: 0x0200001A RID: 26
public struct Enumerator : IEnumerator, IDisposable, IEnumerator<TKey>
{
// Token: 0x060000D8 RID: 216 RVA: 0x00004CA0 File Offset: 0x00002EA0
internal Enumerator(SortedDictionary<TKey, TValue> dic)
{
this.host = dic.tree.GetEnumerator();
}
/// <summary>Gets the element at the current position of the enumerator.</summary>
/// <returns>The element in the collection at the current position of the enumerator.</returns>
/// <exception cref="T:System.InvalidOperationException">The enumerator is positioned before the first element of the collection or after the last element. </exception>
// Token: 0x17000034 RID: 52
// (get) Token: 0x060000D9 RID: 217 RVA: 0x00004CB4 File Offset: 0x00002EB4
object IEnumerator.Current
{
get
{
this.host.check_current();
return this.current;
}
}
/// <summary>Sets the enumerator to its initial position, which is before the first element in the collection.</summary>
/// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
// Token: 0x060000DA RID: 218 RVA: 0x00004CCC File Offset: 0x00002ECC
void IEnumerator.Reset()
{
this.host.Reset();
}
/// <summary>Gets the element at the current position of the enumerator.</summary>
/// <returns>The element in the <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection" /> at the current position of the enumerator.</returns>
// Token: 0x17000035 RID: 53
// (get) Token: 0x060000DB RID: 219 RVA: 0x00004CDC File Offset: 0x00002EDC
public TKey Current
{
get
{
return this.current;
}
}
/// <summary>Advances the enumerator to the next element of the <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection" />.</summary>
/// <returns>true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.</returns>
/// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
// Token: 0x060000DC RID: 220 RVA: 0x00004CE4 File Offset: 0x00002EE4
public bool MoveNext()
{
if (!this.host.MoveNext())
{
return false;
}
this.current = ((SortedDictionary<TKey, TValue>.Node)this.host.Current).key;
return true;
}
/// <summary>Releases all resources used by the <see cref="T:System.Collections.Generic.SortedDictionary`2.KeyCollection.Enumerator" />.</summary>
// Token: 0x060000DD RID: 221 RVA: 0x00004D20 File Offset: 0x00002F20
public void Dispose()
{
this.host.Dispose();
}
// Token: 0x04000053 RID: 83
private RBTree.NodeEnumerator host;
// Token: 0x04000054 RID: 84
private TKey current;
}
}
/// <summary>Enumerates the elements of a <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</summary>
// Token: 0x0200001B RID: 27
public struct Enumerator : IEnumerator, IDisposable, IEnumerator<KeyValuePair<TKey, TValue>>, IDictionaryEnumerator
{
// Token: 0x060000DE RID: 222 RVA: 0x00004D30 File Offset: 0x00002F30
internal Enumerator(SortedDictionary<TKey, TValue> dic)
{
this.host = dic.tree.GetEnumerator();
}
/// <summary>Gets the element at the current position of the enumerator as a <see cref="T:System.Collections.DictionaryEntry" /> structure.</summary>
/// <returns>The element in the collection at the current position of the dictionary, as a <see cref="T:System.Collections.DictionaryEntry" /> structure.</returns>
/// <exception cref="T:System.InvalidOperationException">The enumerator is positioned before the first element of the collection or after the last element. </exception>
// Token: 0x17000036 RID: 54
// (get) Token: 0x060000DF RID: 223 RVA: 0x00004D44 File Offset: 0x00002F44
DictionaryEntry IDictionaryEnumerator.Entry
{
get
{
return this.CurrentNode.AsDE();
}
}
/// <summary>Gets the key of the element at the current position of the enumerator.</summary>
/// <returns>The key of the element in the collection at the current position of the enumerator.</returns>
/// <exception cref="T:System.InvalidOperationException">The enumerator is positioned before the first element of the collection or after the last element. </exception>
// Token: 0x17000037 RID: 55
// (get) Token: 0x060000E0 RID: 224 RVA: 0x00004D54 File Offset: 0x00002F54
object IDictionaryEnumerator.Key
{
get
{
return this.CurrentNode.key;
}
}
/// <summary>Gets the value of the element at the current position of the enumerator.</summary>
/// <returns>The value of the element in the collection at the current position of the enumerator.</returns>
/// <exception cref="T:System.InvalidOperationException">The enumerator is positioned before the first element of the collection or after the last element. </exception>
// Token: 0x17000038 RID: 56
// (get) Token: 0x060000E1 RID: 225 RVA: 0x00004D68 File Offset: 0x00002F68
object IDictionaryEnumerator.Value
{
get
{
return this.CurrentNode.value;
}
}
/// <summary>Gets the element at the current position of the enumerator.</summary>
/// <returns>The element in the collection at the current position of the enumerator.</returns>
/// <exception cref="T:System.InvalidOperationException">The enumerator is positioned before the first element of the collection or after the last element. </exception>
// Token: 0x17000039 RID: 57
// (get) Token: 0x060000E2 RID: 226 RVA: 0x00004D7C File Offset: 0x00002F7C
object IEnumerator.Current
{
get
{
return this.CurrentNode.AsDE();
}
}
/// <summary>Sets the enumerator to its initial position, which is before the first element in the collection.</summary>
/// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
// Token: 0x060000E3 RID: 227 RVA: 0x00004D90 File Offset: 0x00002F90
void IEnumerator.Reset()
{
this.host.Reset();
}
/// <summary>Gets the element at the current position of the enumerator.</summary>
/// <returns>The element in the <see cref="T:System.Collections.Generic.SortedDictionary`2" /> at the current position of the enumerator.</returns>
// Token: 0x1700003A RID: 58
// (get) Token: 0x060000E4 RID: 228 RVA: 0x00004DA0 File Offset: 0x00002FA0
public KeyValuePair<TKey, TValue> Current
{
get
{
return this.current;
}
}
/// <summary>Advances the enumerator to the next element of the <see cref="T:System.Collections.Generic.SortedDictionary`2" />.</summary>
/// <returns>true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.</returns>
/// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
// Token: 0x060000E5 RID: 229 RVA: 0x00004DA8 File Offset: 0x00002FA8
public bool MoveNext()
{
if (!this.host.MoveNext())
{
return false;
}
this.current = ((SortedDictionary<TKey, TValue>.Node)this.host.Current).AsKV();
return true;
}
/// <summary>Releases all resources used by the <see cref="T:System.Collections.Generic.SortedDictionary`2.Enumerator" />.</summary>
// Token: 0x060000E6 RID: 230 RVA: 0x00004DE4 File Offset: 0x00002FE4
public void Dispose()
{
this.host.Dispose();
}
// Token: 0x1700003B RID: 59
// (get) Token: 0x060000E7 RID: 231 RVA: 0x00004DF4 File Offset: 0x00002FF4
private SortedDictionary<TKey, TValue>.Node CurrentNode
{
get
{
this.host.check_current();
return (SortedDictionary<TKey, TValue>.Node)this.host.Current;
}
}
// Token: 0x04000055 RID: 85
private RBTree.NodeEnumerator host;
// Token: 0x04000056 RID: 86
private KeyValuePair<TKey, TValue> current;
}
}
}
+1601
View File
@@ -0,0 +1,1601 @@
using System;
using System.Runtime.InteropServices;
namespace System.Collections.Generic
{
/// <summary>Represents a collection of key/value pairs that are sorted by key based on the associated <see cref="T:System.Collections.Generic.IComparer`1" /> implementation.</summary>
/// <typeparam name="TKey">The type of keys in the collection.</typeparam>
/// <typeparam name="TValue">The type of values in the collection.</typeparam>
// Token: 0x0200001C RID: 28
[ComVisible(false)]
[Serializable]
public class SortedList<TKey, TValue> : ICollection, IDictionary, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable, IDictionary<TKey, TValue>
{
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.SortedList`2" /> class that is empty, has the default initial capacity, and uses the default <see cref="T:System.Collections.Generic.IComparer`1" />.</summary>
// Token: 0x060000E8 RID: 232 RVA: 0x00004E14 File Offset: 0x00003014
public SortedList()
: this(SortedList<TKey, TValue>.INITIAL_SIZE, null)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.SortedList`2" /> class that is empty, has the specified initial capacity, and uses the default <see cref="T:System.Collections.Generic.IComparer`1" />.</summary>
/// <param name="capacity">The initial number of elements that the <see cref="T:System.Collections.Generic.SortedList`2" /> can contain.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="capacity" /> is less than zero.</exception>
// Token: 0x060000E9 RID: 233 RVA: 0x00004E24 File Offset: 0x00003024
public SortedList(int capacity)
: this(capacity, null)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.SortedList`2" /> class that is empty, has the specified initial capacity, and uses the specified <see cref="T:System.Collections.Generic.IComparer`1" />.</summary>
/// <param name="capacity">The initial number of elements that the <see cref="T:System.Collections.Generic.SortedList`2" /> can contain.</param>
/// <param name="comparer">The <see cref="T:System.Collections.Generic.IComparer`1" /> implementation to use when comparing keys.-or-null to use the default <see cref="T:System.Collections.Generic.Comparer`1" /> for the type of the key.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="capacity" /> is less than zero.</exception>
// Token: 0x060000EA RID: 234 RVA: 0x00004E30 File Offset: 0x00003030
public SortedList(int capacity, IComparer<TKey> comparer)
{
if (capacity < 0)
{
throw new ArgumentOutOfRangeException("initialCapacity");
}
if (capacity == 0)
{
this.defaultCapacity = 0;
}
else
{
this.defaultCapacity = SortedList<TKey, TValue>.INITIAL_SIZE;
}
this.Init(comparer, capacity, true);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.SortedList`2" /> class that is empty, has the default initial capacity, and uses the specified <see cref="T:System.Collections.Generic.IComparer`1" />.</summary>
/// <param name="comparer">The <see cref="T:System.Collections.Generic.IComparer`1" /> implementation to use when comparing keys.-or-null to use the default <see cref="T:System.Collections.Generic.Comparer`1" /> for the type of the key.</param>
// Token: 0x060000EB RID: 235 RVA: 0x00004E7C File Offset: 0x0000307C
public SortedList(IComparer<TKey> comparer)
: this(SortedList<TKey, TValue>.INITIAL_SIZE, comparer)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.SortedList`2" /> class that contains elements copied from the specified <see cref="T:System.Collections.Generic.IDictionary`2" />, has sufficient capacity to accommodate the number of elements copied, and uses the default <see cref="T:System.Collections.Generic.IComparer`1" />.</summary>
/// <param name="dictionary">The <see cref="T:System.Collections.Generic.IDictionary`2" /> whose elements are copied to the new <see cref="T:System.Collections.Generic.SortedList`2" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="dictionary" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="dictionary" /> contains one or more duplicate keys.</exception>
// Token: 0x060000EC RID: 236 RVA: 0x00004E8C File Offset: 0x0000308C
public SortedList(IDictionary<TKey, TValue> dictionary)
: this(dictionary, null)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.SortedList`2" /> class that contains elements copied from the specified <see cref="T:System.Collections.Generic.IDictionary`2" />, has sufficient capacity to accommodate the number of elements copied, and uses the specified <see cref="T:System.Collections.Generic.IComparer`1" />.</summary>
/// <param name="dictionary">The <see cref="T:System.Collections.Generic.IDictionary`2" /> whose elements are copied to the new <see cref="T:System.Collections.Generic.SortedList`2" />.</param>
/// <param name="comparer">The <see cref="T:System.Collections.Generic.IComparer`1" /> implementation to use when comparing keys.-or-null to use the default <see cref="T:System.Collections.Generic.Comparer`1" /> for the type of the key.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="dictionary" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="dictionary" /> contains one or more duplicate keys.</exception>
// Token: 0x060000ED RID: 237 RVA: 0x00004E98 File Offset: 0x00003098
public SortedList(IDictionary<TKey, TValue> dictionary, IComparer<TKey> comparer)
{
if (dictionary == null)
{
throw new ArgumentNullException("dictionary");
}
this.Init(comparer, dictionary.Count, true);
foreach (KeyValuePair<TKey, TValue> keyValuePair in dictionary)
{
this.Add(keyValuePair.Key, keyValuePair.Value);
}
}
/// <summary>Gets a value indicating whether access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe).</summary>
/// <returns>true if access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe); otherwise, false. In the default implementation of <see cref="T:System.Collections.Generic.SortedList`2" />, this property always returns false.</returns>
// Token: 0x1700003C RID: 60
// (get) Token: 0x060000EF RID: 239 RVA: 0x00004F34 File Offset: 0x00003134
bool ICollection.IsSynchronized
{
get
{
return false;
}
}
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />.</summary>
/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />. In the default implementation of <see cref="T:System.Collections.Generic.SortedList`2" />, this property always returns the current instance.</returns>
// Token: 0x1700003D RID: 61
// (get) Token: 0x060000F0 RID: 240 RVA: 0x00004F38 File Offset: 0x00003138
object ICollection.SyncRoot
{
get
{
return this;
}
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.IDictionary" /> has a fixed size.</summary>
/// <returns>true if the <see cref="T:System.Collections.IDictionary" /> has a fixed size; otherwise, false. In the default implementation of <see cref="T:System.Collections.Generic.SortedList`2" />, this property always returns false.</returns>
// Token: 0x1700003E RID: 62
// (get) Token: 0x060000F1 RID: 241 RVA: 0x00004F3C File Offset: 0x0000313C
bool IDictionary.IsFixedSize
{
get
{
return false;
}
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.IDictionary" /> is read-only.</summary>
/// <returns>true if the <see cref="T:System.Collections.IDictionary" /> is read-only; otherwise, false. In the default implementation of <see cref="T:System.Collections.Generic.SortedList`2" />, this property always returns false.</returns>
// Token: 0x1700003F RID: 63
// (get) Token: 0x060000F2 RID: 242 RVA: 0x00004F40 File Offset: 0x00003140
bool IDictionary.IsReadOnly
{
get
{
return false;
}
}
/// <summary>Gets or sets the element with the specified key.</summary>
/// <returns>The element with the specified key, or null if <paramref name="key" /> is not in the dictionary or <paramref name="key" /> is of a type that is not assignable to the key type <paramref name="TKey" /> of the <see cref="T:System.Collections.Generic.SortedList`2" />.</returns>
/// <param name="key">The key of the element to get or set.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">A value is being assigned, and <paramref name="key" /> is of a type that is not assignable to the key type <paramref name="TKey" /> of the <see cref="T:System.Collections.Generic.SortedList`2" />.-or-A value is being assigned, and <paramref name="value" /> is of a type that is not assignable to the value type <paramref name="TValue" /> of the <see cref="T:System.Collections.Generic.SortedList`2" />.</exception>
// Token: 0x17000040 RID: 64
object IDictionary.this[object key]
{
get
{
if (!(key is TKey))
{
return null;
}
return this[(TKey)((object)key)];
}
set
{
this[this.ToKey(key)] = this.ToValue(value);
}
}
/// <summary>Gets an <see cref="T:System.Collections.ICollection" /> containing the keys of the <see cref="T:System.Collections.IDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.ICollection" /> containing the keys of the <see cref="T:System.Collections.IDictionary" />.</returns>
// Token: 0x17000041 RID: 65
// (get) Token: 0x060000F5 RID: 245 RVA: 0x00004F7C File Offset: 0x0000317C
ICollection IDictionary.Keys
{
get
{
return new SortedList<TKey, TValue>.ListKeys(this);
}
}
/// <summary>Gets an <see cref="T:System.Collections.ICollection" /> containing the values in the <see cref="T:System.Collections.IDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.ICollection" /> containing the values in the <see cref="T:System.Collections.IDictionary" />.</returns>
// Token: 0x17000042 RID: 66
// (get) Token: 0x060000F6 RID: 246 RVA: 0x00004F84 File Offset: 0x00003184
ICollection IDictionary.Values
{
get
{
return new SortedList<TKey, TValue>.ListValues(this);
}
}
// Token: 0x17000043 RID: 67
// (get) Token: 0x060000F7 RID: 247 RVA: 0x00004F8C File Offset: 0x0000318C
ICollection<TKey> IDictionary<TKey, TValue>.Keys
{
get
{
return this.Keys;
}
}
// Token: 0x17000044 RID: 68
// (get) Token: 0x060000F8 RID: 248 RVA: 0x00004F94 File Offset: 0x00003194
ICollection<TValue> IDictionary<TKey, TValue>.Values
{
get
{
return this.Values;
}
}
// Token: 0x17000045 RID: 69
// (get) Token: 0x060000F9 RID: 249 RVA: 0x00004F9C File Offset: 0x0000319C
bool ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly
{
get
{
return false;
}
}
// Token: 0x060000FA RID: 250 RVA: 0x00004FA0 File Offset: 0x000031A0
void ICollection<KeyValuePair<TKey, TValue>>.Clear()
{
this.defaultCapacity = SortedList<TKey, TValue>.INITIAL_SIZE;
this.table = new KeyValuePair<TKey, TValue>[this.defaultCapacity];
this.inUse = 0;
this.modificationCount++;
}
// Token: 0x060000FB RID: 251 RVA: 0x00004FD4 File Offset: 0x000031D4
void ICollection<KeyValuePair<TKey, TValue>>.CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
{
if (this.Count == 0)
{
return;
}
if (array == null)
{
throw new ArgumentNullException();
}
if (arrayIndex < 0)
{
throw new ArgumentOutOfRangeException();
}
if (arrayIndex >= array.Length)
{
throw new ArgumentNullException("arrayIndex is greater than or equal to array.Length");
}
if (this.Count > array.Length - arrayIndex)
{
throw new ArgumentNullException("Not enough space in array from arrayIndex to end of array");
}
int num = arrayIndex;
foreach (KeyValuePair<TKey, TValue> keyValuePair in this)
{
array[num++] = keyValuePair;
}
}
// Token: 0x060000FC RID: 252 RVA: 0x00005094 File Offset: 0x00003294
void ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue> keyValuePair)
{
this.Add(keyValuePair.Key, keyValuePair.Value);
}
// Token: 0x060000FD RID: 253 RVA: 0x000050AC File Offset: 0x000032AC
bool ICollection<KeyValuePair<TKey, TValue>>.Contains(KeyValuePair<TKey, TValue> keyValuePair)
{
int num = this.Find(keyValuePair.Key);
return num >= 0 && Comparer<KeyValuePair<TKey, TValue>>.Default.Compare(this.table[num], keyValuePair) == 0;
}
// Token: 0x060000FE RID: 254 RVA: 0x000050F0 File Offset: 0x000032F0
bool ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue> keyValuePair)
{
int num = this.Find(keyValuePair.Key);
if (num >= 0 && Comparer<KeyValuePair<TKey, TValue>>.Default.Compare(this.table[num], keyValuePair) == 0)
{
this.RemoveAt(num);
return true;
}
return false;
}
// Token: 0x060000FF RID: 255 RVA: 0x00005140 File Offset: 0x00003340
IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()
{
for (int i = 0; i < this.inUse; i++)
{
KeyValuePair<TKey, TValue> current = this.table[i];
yield return new KeyValuePair<TKey, TValue>(current.Key, current.Value);
}
yield break;
}
/// <summary>Returns an enumerator that iterates through a collection.</summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> that can be used to iterate through the collection.</returns>
// Token: 0x06000100 RID: 256 RVA: 0x0000515C File Offset: 0x0000335C
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
/// <summary>Adds an element with the provided key and value to the <see cref="T:System.Collections.IDictionary" />.</summary>
/// <param name="key">The <see cref="T:System.Object" /> to use as the key of the element to add.</param>
/// <param name="value">The <see cref="T:System.Object" /> to use as the value of the element to add.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="key" /> is of a type that is not assignable to the key type <paramref name="TKey" /> of the <see cref="T:System.Collections.IDictionary" />.-or-<paramref name="value" /> is of a type that is not assignable to the value type <paramref name="TValue" /> of the <see cref="T:System.Collections.IDictionary" />.-or-An element with the same key already exists in the <see cref="T:System.Collections.IDictionary" />.</exception>
// Token: 0x06000101 RID: 257 RVA: 0x00005164 File Offset: 0x00003364
void IDictionary.Add(object key, object value)
{
this.PutImpl(this.ToKey(key), this.ToValue(value), false);
}
/// <summary>Determines whether the <see cref="T:System.Collections.IDictionary" /> contains an element with the specified key.</summary>
/// <returns>true if the <see cref="T:System.Collections.IDictionary" /> contains an element with the key; otherwise, false.</returns>
/// <param name="key">The key to locate in the <see cref="T:System.Collections.IDictionary" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x06000102 RID: 258 RVA: 0x00005188 File Offset: 0x00003388
bool IDictionary.Contains(object key)
{
if (key == null)
{
throw new ArgumentNullException();
}
return key is TKey && this.Find((TKey)((object)key)) >= 0;
}
/// <summary>Returns an <see cref="T:System.Collections.IDictionaryEnumerator" /> for the <see cref="T:System.Collections.IDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.IDictionaryEnumerator" /> for the <see cref="T:System.Collections.IDictionary" />.</returns>
// Token: 0x06000103 RID: 259 RVA: 0x000051B8 File Offset: 0x000033B8
IDictionaryEnumerator IDictionary.GetEnumerator()
{
return new SortedList<TKey, TValue>.Enumerator(this, SortedList<TKey, TValue>.EnumeratorMode.ENTRY_MODE);
}
/// <summary>Removes the element with the specified key from the <see cref="T:System.Collections.IDictionary" />.</summary>
/// <param name="key">The key of the element to remove.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x06000104 RID: 260 RVA: 0x000051C4 File Offset: 0x000033C4
void IDictionary.Remove(object key)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
if (!(key is TKey))
{
return;
}
int num = this.IndexOfKey((TKey)((object)key));
if (num >= 0)
{
this.RemoveAt(num);
}
}
/// <summary>Copies the elements of the <see cref="T:System.Collections.ICollection" /> to an <see cref="T:System.Array" />, starting at a particular <see cref="T:System.Array" /> index.</summary>
/// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from <see cref="T:System.Collections.ICollection" />. The <see cref="T:System.Array" /> must have zero-based indexing.</param>
/// <param name="arrayIndex">The zero-based index in <paramref name="array" /> at which copying begins.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="arrayIndex" /> is less than zero.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or-<paramref name="array" /> does not have zero-based indexing.-or-The number of elements in the source <see cref="T:System.Collections.ICollection" /> is greater than the available space from <paramref name="arrayIndex" /> to the end of the destination <paramref name="array" />.-or-The type of the source <see cref="T:System.Collections.ICollection" /> cannot be cast automatically to the type of the destination <paramref name="array" />.</exception>
// Token: 0x06000105 RID: 261 RVA: 0x0000520C File Offset: 0x0000340C
void ICollection.CopyTo(Array array, int arrayIndex)
{
if (this.Count == 0)
{
return;
}
if (array == null)
{
throw new ArgumentNullException();
}
if (arrayIndex < 0)
{
throw new ArgumentOutOfRangeException();
}
if (array.Rank > 1)
{
throw new ArgumentException("array is multi-dimensional");
}
if (arrayIndex >= array.Length)
{
throw new ArgumentNullException("arrayIndex is greater than or equal to array.Length");
}
if (this.Count > array.Length - arrayIndex)
{
throw new ArgumentNullException("Not enough space in array from arrayIndex to end of array");
}
IEnumerator<KeyValuePair<TKey, TValue>> enumerator = this.GetEnumerator();
int num = arrayIndex;
while (enumerator.MoveNext())
{
KeyValuePair<TKey, TValue> keyValuePair = enumerator.Current;
array.SetValue(keyValuePair, num++);
}
}
/// <summary>Gets the number of key/value pairs contained in the <see cref="T:System.Collections.Generic.SortedList`2" />.</summary>
/// <returns>The number of key/value pairs contained in the <see cref="T:System.Collections.Generic.SortedList`2" />.</returns>
// Token: 0x17000046 RID: 70
// (get) Token: 0x06000106 RID: 262 RVA: 0x000052BC File Offset: 0x000034BC
public int Count
{
get
{
return this.inUse;
}
}
/// <summary>Gets or sets the value associated with the specified key.</summary>
/// <returns>The value associated with the specified key. If the specified key is not found, a get operation throws a <see cref="T:System.Collections.Generic.KeyNotFoundException" /> and a set operation creates a new element using the specified key.</returns>
/// <param name="key">The key whose value to get or set.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
/// <exception cref="T:System.Collections.Generic.KeyNotFoundException">The property is retrieved and <paramref name="key" /> does not exist in the collection.</exception>
// Token: 0x17000047 RID: 71
public TValue this[TKey key]
{
get
{
if (key == null)
{
throw new ArgumentNullException("key");
}
int num = this.Find(key);
if (num >= 0)
{
return this.table[num].Value;
}
throw new KeyNotFoundException();
}
set
{
if (key == null)
{
throw new ArgumentNullException("key");
}
this.PutImpl(key, value, true);
}
}
/// <summary>Gets or sets the number of elements that the <see cref="T:System.Collections.Generic.SortedList`2" /> can contain.</summary>
/// <returns>The number of elements that the <see cref="T:System.Collections.Generic.SortedList`2" /> can contain.</returns>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <see cref="P:System.Collections.Generic.SortedList`2.Capacity" /> is set to a value that is less than <see cref="P:System.Collections.Generic.SortedList`2.Count" />.</exception>
/// <exception cref="T:System.OutOfMemoryException">There is not enough memory available on the system.</exception>
// Token: 0x17000048 RID: 72
// (get) Token: 0x06000109 RID: 265 RVA: 0x00005334 File Offset: 0x00003534
// (set) Token: 0x0600010A RID: 266 RVA: 0x00005340 File Offset: 0x00003540
public int Capacity
{
get
{
return this.table.Length;
}
set
{
int num = this.table.Length;
if (this.inUse > value)
{
throw new ArgumentOutOfRangeException("capacity too small");
}
if (value == 0)
{
KeyValuePair<TKey, TValue>[] array = new KeyValuePair<TKey, TValue>[this.defaultCapacity];
Array.Copy(this.table, array, this.inUse);
this.table = array;
}
else if (value > this.inUse)
{
KeyValuePair<TKey, TValue>[] array2 = new KeyValuePair<TKey, TValue>[value];
Array.Copy(this.table, array2, this.inUse);
this.table = array2;
}
else if (value > num)
{
KeyValuePair<TKey, TValue>[] array3 = new KeyValuePair<TKey, TValue>[value];
Array.Copy(this.table, array3, num);
this.table = array3;
}
}
}
/// <summary>Gets a collection containing the keys in the <see cref="T:System.Collections.Generic.SortedList`2" />.</summary>
/// <returns>A <see cref="T:System.Collections.Generic.IList`1" /> containing the keys in the <see cref="T:System.Collections.Generic.SortedList`2" />.</returns>
// Token: 0x17000049 RID: 73
// (get) Token: 0x0600010B RID: 267 RVA: 0x000053F0 File Offset: 0x000035F0
public IList<TKey> Keys
{
get
{
return new SortedList<TKey, TValue>.ListKeys(this);
}
}
/// <summary>Gets a collection containing the values in the <see cref="T:System.Collections.Generic.SortedList`2" />.</summary>
/// <returns>A <see cref="T:System.Collections.Generic.IList`1" /> containing the values in the <see cref="T:System.Collections.Generic.SortedList`2" />.</returns>
// Token: 0x1700004A RID: 74
// (get) Token: 0x0600010C RID: 268 RVA: 0x000053F8 File Offset: 0x000035F8
public IList<TValue> Values
{
get
{
return new SortedList<TKey, TValue>.ListValues(this);
}
}
/// <summary>Gets the <see cref="T:System.Collections.Generic.IComparer`1" /> for the sorted list. </summary>
/// <returns>The <see cref="T:System.IComparable`1" /> for the current <see cref="T:System.Collections.Generic.SortedList`2" />.</returns>
// Token: 0x1700004B RID: 75
// (get) Token: 0x0600010D RID: 269 RVA: 0x00005400 File Offset: 0x00003600
public IComparer<TKey> Comparer
{
get
{
return this.comparer;
}
}
/// <summary>Adds an element with the specified key and value into the <see cref="T:System.Collections.Generic.SortedList`2" />.</summary>
/// <param name="key">The key of the element to add.</param>
/// <param name="value">The value of the element to add. The value can be null for reference types.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">An element with the same key already exists in the <see cref="T:System.Collections.Generic.SortedList`2" />.</exception>
// Token: 0x0600010E RID: 270 RVA: 0x00005408 File Offset: 0x00003608
public void Add(TKey key, TValue value)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
this.PutImpl(key, value, false);
}
/// <summary>Determines whether the <see cref="T:System.Collections.Generic.SortedList`2" /> contains a specific key.</summary>
/// <returns>true if the <see cref="T:System.Collections.Generic.SortedList`2" /> contains an element with the specified key; otherwise, false.</returns>
/// <param name="key">The key to locate in the <see cref="T:System.Collections.Generic.SortedList`2" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x0600010F RID: 271 RVA: 0x0000542C File Offset: 0x0000362C
public bool ContainsKey(TKey key)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
return this.Find(key) >= 0;
}
/// <summary>Returns an enumerator that iterates through the <see cref="T:System.Collections.Generic.SortedList`2" />.</summary>
/// <returns>An <see cref="T:System.Collections.Generic.IEnumerator`1" /> of type <see cref="T:System.Collections.Generic.KeyValuePair`2" /> for the <see cref="T:System.Collections.Generic.SortedList`2" />.</returns>
// Token: 0x06000110 RID: 272 RVA: 0x00005454 File Offset: 0x00003654
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
{
for (int i = 0; i < this.inUse; i++)
{
KeyValuePair<TKey, TValue> current = this.table[i];
yield return new KeyValuePair<TKey, TValue>(current.Key, current.Value);
}
yield break;
}
/// <summary>Removes the element with the specified key from the <see cref="T:System.Collections.Generic.SortedList`2" />.</summary>
/// <returns>true if the element is successfully removed; otherwise, false. This method also returns false if <paramref name="key" /> was not found in the original <see cref="T:System.Collections.Generic.SortedList`2" />.</returns>
/// <param name="key">The key of the element to remove.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x06000111 RID: 273 RVA: 0x00005470 File Offset: 0x00003670
public bool Remove(TKey key)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
int num = this.IndexOfKey(key);
if (num >= 0)
{
this.RemoveAt(num);
return true;
}
return false;
}
/// <summary>Removes all elements from the <see cref="T:System.Collections.Generic.SortedList`2" />.</summary>
// Token: 0x06000112 RID: 274 RVA: 0x000054AC File Offset: 0x000036AC
public void Clear()
{
this.defaultCapacity = SortedList<TKey, TValue>.INITIAL_SIZE;
this.table = new KeyValuePair<TKey, TValue>[this.defaultCapacity];
this.inUse = 0;
this.modificationCount++;
}
/// <summary>Removes the element at the specified index of the <see cref="T:System.Collections.Generic.SortedList`2" />.</summary>
/// <param name="index">The zero-based index of the element to remove.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero.-or-<paramref name="index" /> is equal to or greater than <see cref="P:System.Collections.Generic.SortedList`2.Count" />.</exception>
// Token: 0x06000113 RID: 275 RVA: 0x000054E0 File Offset: 0x000036E0
public void RemoveAt(int index)
{
KeyValuePair<TKey, TValue>[] array = this.table;
int count = this.Count;
if (index >= 0 && index < count)
{
if (index != count - 1)
{
Array.Copy(array, index + 1, array, index, count - 1 - index);
}
else
{
array[index] = default(KeyValuePair<TKey, TValue>);
}
this.inUse--;
this.modificationCount++;
return;
}
throw new ArgumentOutOfRangeException("index out of range");
}
/// <summary>Searches for the specified key and returns the zero-based index within the entire <see cref="T:System.Collections.Generic.SortedList`2" />.</summary>
/// <returns>The zero-based index of <paramref name="key" /> within the entire <see cref="T:System.Collections.Generic.SortedList`2" />, if found; otherwise, -1.</returns>
/// <param name="key">The key to locate in the <see cref="T:System.Collections.Generic.SortedList`2" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x06000114 RID: 276 RVA: 0x00005568 File Offset: 0x00003768
public int IndexOfKey(TKey key)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
int num = 0;
try
{
num = this.Find(key);
}
catch (Exception)
{
throw new InvalidOperationException();
}
return num | (num >> 31);
}
/// <summary>Searches for the specified value and returns the zero-based index of the first occurrence within the entire <see cref="T:System.Collections.Generic.SortedList`2" />.</summary>
/// <returns>The zero-based index of the first occurrence of <paramref name="value" /> within the entire <see cref="T:System.Collections.Generic.SortedList`2" />, if found; otherwise, -1.</returns>
/// <param name="value">The value to locate in the <see cref="T:System.Collections.Generic.SortedList`2" />. The value can be null for reference types.</param>
// Token: 0x06000115 RID: 277 RVA: 0x000055C8 File Offset: 0x000037C8
public int IndexOfValue(TValue value)
{
if (this.inUse == 0)
{
return -1;
}
for (int i = 0; i < this.inUse; i++)
{
KeyValuePair<TKey, TValue> keyValuePair = this.table[i];
if (object.Equals(value, keyValuePair.Value))
{
return i;
}
}
return -1;
}
/// <summary>Determines whether the <see cref="T:System.Collections.Generic.SortedList`2" /> contains a specific value.</summary>
/// <returns>true if the <see cref="T:System.Collections.Generic.SortedList`2" /> contains an element with the specified value; otherwise, false.</returns>
/// <param name="value">The value to locate in the <see cref="T:System.Collections.Generic.SortedList`2" />. The value can be null for reference types.</param>
// Token: 0x06000116 RID: 278 RVA: 0x0000562C File Offset: 0x0000382C
public bool ContainsValue(TValue value)
{
return this.IndexOfValue(value) >= 0;
}
/// <summary>Sets the capacity to the actual number of elements in the <see cref="T:System.Collections.Generic.SortedList`2" />, if that number is less than 90 percent of current capacity.</summary>
// Token: 0x06000117 RID: 279 RVA: 0x0000563C File Offset: 0x0000383C
public void TrimExcess()
{
if ((double)this.inUse < (double)this.table.Length * 0.9)
{
this.Capacity = this.inUse;
}
}
/// <summary>Gets the value associated with the specified key.</summary>
/// <returns>true if the <see cref="T:System.Collections.Generic.SortedList`2" /> contains an element with the specified key; otherwise, false.</returns>
/// <param name="key">The key whose value to get.</param>
/// <param name="value">When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the <paramref name="value" /> parameter. This parameter is passed uninitialized.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x06000118 RID: 280 RVA: 0x0000566C File Offset: 0x0000386C
public bool TryGetValue(TKey key, out TValue value)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
int num = this.Find(key);
if (num >= 0)
{
value = this.table[num].Value;
return true;
}
value = default(TValue);
return false;
}
// Token: 0x06000119 RID: 281 RVA: 0x000056C8 File Offset: 0x000038C8
private void EnsureCapacity(int n, int free)
{
KeyValuePair<TKey, TValue>[] array = this.table;
KeyValuePair<TKey, TValue>[] array2 = null;
int capacity = this.Capacity;
bool flag = free >= 0 && free < this.Count;
if (n > capacity)
{
array2 = new KeyValuePair<TKey, TValue>[n << 1];
}
if (array2 != null)
{
if (flag)
{
if (free > 0)
{
Array.Copy(array, 0, array2, 0, free);
}
int num = this.Count - free;
if (num > 0)
{
Array.Copy(array, free, array2, free + 1, num);
}
}
else
{
Array.Copy(array, array2, this.Count);
}
this.table = array2;
}
else if (flag)
{
Array.Copy(array, free, array, free + 1, this.Count - free);
}
}
// Token: 0x0600011A RID: 282 RVA: 0x00005784 File Offset: 0x00003984
private void PutImpl(TKey key, TValue value, bool overwrite)
{
if (key == null)
{
throw new ArgumentNullException("null key");
}
KeyValuePair<TKey, TValue>[] array = this.table;
int num = -1;
try
{
num = this.Find(key);
}
catch (Exception)
{
throw new InvalidOperationException();
}
if (num >= 0)
{
if (!overwrite)
{
throw new ArgumentException("element already exists");
}
array[num] = new KeyValuePair<TKey, TValue>(key, value);
this.modificationCount++;
return;
}
else
{
num = ~num;
if (num > this.Capacity + 1)
{
throw new Exception(string.Concat(new object[] { "SortedList::internal error (", key, ", ", value, ") at [", num, "]" }));
}
this.EnsureCapacity(this.Count + 1, num);
array = this.table;
array[num] = new KeyValuePair<TKey, TValue>(key, value);
this.inUse++;
this.modificationCount++;
return;
}
}
// Token: 0x0600011B RID: 283 RVA: 0x000058C4 File Offset: 0x00003AC4
private void Init(IComparer<TKey> comparer, int capacity, bool forceSize)
{
if (comparer == null)
{
comparer = Comparer<TKey>.Default;
}
this.comparer = comparer;
if (!forceSize && capacity < this.defaultCapacity)
{
capacity = this.defaultCapacity;
}
this.table = new KeyValuePair<TKey, TValue>[capacity];
this.inUse = 0;
this.modificationCount = 0;
}
// Token: 0x0600011C RID: 284 RVA: 0x0000591C File Offset: 0x00003B1C
private void CopyToArray(Array arr, int i, SortedList<TKey, TValue>.EnumeratorMode mode)
{
if (arr == null)
{
throw new ArgumentNullException("arr");
}
if (i < 0 || i + this.Count > arr.Length)
{
throw new ArgumentOutOfRangeException("i");
}
IEnumerator enumerator = new SortedList<TKey, TValue>.Enumerator(this, mode);
while (enumerator.MoveNext())
{
object obj = enumerator.Current;
arr.SetValue(obj, i++);
}
}
// Token: 0x0600011D RID: 285 RVA: 0x0000598C File Offset: 0x00003B8C
private int Find(TKey key)
{
KeyValuePair<TKey, TValue>[] array = this.table;
int count = this.Count;
if (count == 0)
{
return -1;
}
int i = 0;
int num = count - 1;
while (i <= num)
{
int num2 = i + num >> 1;
int num3 = this.comparer.Compare(array[num2].Key, key);
if (num3 == 0)
{
return num2;
}
if (num3 < 0)
{
i = num2 + 1;
}
else
{
num = num2 - 1;
}
}
return ~i;
}
// Token: 0x0600011E RID: 286 RVA: 0x00005A08 File Offset: 0x00003C08
private TKey ToKey(object key)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
if (!(key is TKey))
{
throw new ArgumentException(string.Concat(new object[]
{
"The value \"",
key,
"\" isn't of type \"",
typeof(TKey),
"\" and can't be used in this generic collection."
}), "key");
}
return (TKey)((object)key);
}
// Token: 0x0600011F RID: 287 RVA: 0x00005A78 File Offset: 0x00003C78
private TValue ToValue(object value)
{
if (!(value is TValue))
{
throw new ArgumentException(string.Concat(new object[]
{
"The value \"",
value,
"\" isn't of type \"",
typeof(TValue),
"\" and can't be used in this generic collection."
}), "value");
}
return (TValue)((object)value);
}
// Token: 0x06000120 RID: 288 RVA: 0x00005AD8 File Offset: 0x00003CD8
internal TKey KeyAt(int index)
{
if (index >= 0 && index < this.Count)
{
return this.table[index].Key;
}
throw new ArgumentOutOfRangeException("Index out of range");
}
// Token: 0x06000121 RID: 289 RVA: 0x00005B0C File Offset: 0x00003D0C
internal TValue ValueAt(int index)
{
if (index >= 0 && index < this.Count)
{
return this.table[index].Value;
}
throw new ArgumentOutOfRangeException("Index out of range");
}
// Token: 0x04000057 RID: 87
private static readonly int INITIAL_SIZE = 16;
// Token: 0x04000058 RID: 88
private int inUse;
// Token: 0x04000059 RID: 89
private int modificationCount;
// Token: 0x0400005A RID: 90
private KeyValuePair<TKey, TValue>[] table;
// Token: 0x0400005B RID: 91
private IComparer<TKey> comparer;
// Token: 0x0400005C RID: 92
private int defaultCapacity;
// Token: 0x0200001D RID: 29
private enum EnumeratorMode
{
// Token: 0x0400005E RID: 94
KEY_MODE,
// Token: 0x0400005F RID: 95
VALUE_MODE,
// Token: 0x04000060 RID: 96
ENTRY_MODE
}
// Token: 0x0200001E RID: 30
private sealed class Enumerator : IEnumerator, IDictionaryEnumerator, ICloneable
{
// Token: 0x06000122 RID: 290 RVA: 0x00005B40 File Offset: 0x00003D40
public Enumerator(SortedList<TKey, TValue> host, SortedList<TKey, TValue>.EnumeratorMode mode)
{
this.host = host;
this.stamp = host.modificationCount;
this.size = host.Count;
this.mode = mode;
this.Reset();
}
// Token: 0x06000123 RID: 291 RVA: 0x00005B80 File Offset: 0x00003D80
public Enumerator(SortedList<TKey, TValue> host)
: this(host, SortedList<TKey, TValue>.EnumeratorMode.ENTRY_MODE)
{
}
// Token: 0x06000125 RID: 293 RVA: 0x00005B98 File Offset: 0x00003D98
public void Reset()
{
if (this.host.modificationCount != this.stamp || this.invalid)
{
throw new InvalidOperationException(SortedList<TKey, TValue>.Enumerator.xstr);
}
this.pos = -1;
this.currentKey = null;
this.currentValue = null;
}
// Token: 0x06000126 RID: 294 RVA: 0x00005BE8 File Offset: 0x00003DE8
public bool MoveNext()
{
if (this.host.modificationCount != this.stamp || this.invalid)
{
throw new InvalidOperationException(SortedList<TKey, TValue>.Enumerator.xstr);
}
KeyValuePair<TKey, TValue>[] table = this.host.table;
if (++this.pos < this.size)
{
KeyValuePair<TKey, TValue> keyValuePair = table[this.pos];
this.currentKey = keyValuePair.Key;
this.currentValue = keyValuePair.Value;
return true;
}
this.currentKey = null;
this.currentValue = null;
return false;
}
// Token: 0x1700004C RID: 76
// (get) Token: 0x06000127 RID: 295 RVA: 0x00005C90 File Offset: 0x00003E90
public DictionaryEntry Entry
{
get
{
if (this.invalid || this.pos >= this.size || this.pos == -1)
{
throw new InvalidOperationException(SortedList<TKey, TValue>.Enumerator.xstr);
}
return new DictionaryEntry(this.currentKey, this.currentValue);
}
}
// Token: 0x1700004D RID: 77
// (get) Token: 0x06000128 RID: 296 RVA: 0x00005CE4 File Offset: 0x00003EE4
public object Key
{
get
{
if (this.invalid || this.pos >= this.size || this.pos == -1)
{
throw new InvalidOperationException(SortedList<TKey, TValue>.Enumerator.xstr);
}
return this.currentKey;
}
}
// Token: 0x1700004E RID: 78
// (get) Token: 0x06000129 RID: 297 RVA: 0x00005D20 File Offset: 0x00003F20
public object Value
{
get
{
if (this.invalid || this.pos >= this.size || this.pos == -1)
{
throw new InvalidOperationException(SortedList<TKey, TValue>.Enumerator.xstr);
}
return this.currentValue;
}
}
// Token: 0x1700004F RID: 79
// (get) Token: 0x0600012A RID: 298 RVA: 0x00005D5C File Offset: 0x00003F5C
public object Current
{
get
{
if (this.invalid || this.pos >= this.size || this.pos == -1)
{
throw new InvalidOperationException(SortedList<TKey, TValue>.Enumerator.xstr);
}
switch (this.mode)
{
case SortedList<TKey, TValue>.EnumeratorMode.KEY_MODE:
return this.currentKey;
case SortedList<TKey, TValue>.EnumeratorMode.VALUE_MODE:
return this.currentValue;
case SortedList<TKey, TValue>.EnumeratorMode.ENTRY_MODE:
return this.Entry;
default:
throw new NotSupportedException(this.mode + " is not a supported mode.");
}
}
}
// Token: 0x0600012B RID: 299 RVA: 0x00005DF0 File Offset: 0x00003FF0
public object Clone()
{
return new SortedList<TKey, TValue>.Enumerator(this.host, this.mode)
{
stamp = this.stamp,
pos = this.pos,
size = this.size,
currentKey = this.currentKey,
currentValue = this.currentValue,
invalid = this.invalid
};
}
// Token: 0x04000061 RID: 97
private SortedList<TKey, TValue> host;
// Token: 0x04000062 RID: 98
private int stamp;
// Token: 0x04000063 RID: 99
private int pos;
// Token: 0x04000064 RID: 100
private int size;
// Token: 0x04000065 RID: 101
private SortedList<TKey, TValue>.EnumeratorMode mode;
// Token: 0x04000066 RID: 102
private object currentKey;
// Token: 0x04000067 RID: 103
private object currentValue;
// Token: 0x04000068 RID: 104
private bool invalid;
// Token: 0x04000069 RID: 105
private static readonly string xstr = "SortedList.Enumerator: snapshot out of sync.";
}
// Token: 0x0200001F RID: 31
[Serializable]
public struct KeyEnumerator : IEnumerator, IDisposable, IEnumerator<TKey>
{
// Token: 0x0600012C RID: 300 RVA: 0x00005E58 File Offset: 0x00004058
internal KeyEnumerator(SortedList<TKey, TValue> l)
{
this.l = l;
this.idx = -2;
this.ver = l.modificationCount;
}
// Token: 0x0600012D RID: 301 RVA: 0x00005E78 File Offset: 0x00004078
void IEnumerator.Reset()
{
if (this.ver != this.l.modificationCount)
{
throw new InvalidOperationException("Collection was modified after the enumerator was instantiated.");
}
this.idx = -2;
}
// Token: 0x17000050 RID: 80
// (get) Token: 0x0600012E RID: 302 RVA: 0x00005EA4 File Offset: 0x000040A4
object IEnumerator.Current
{
get
{
return this.Current;
}
}
// Token: 0x0600012F RID: 303 RVA: 0x00005EB4 File Offset: 0x000040B4
public void Dispose()
{
this.idx = -2;
}
// Token: 0x06000130 RID: 304 RVA: 0x00005EC0 File Offset: 0x000040C0
public bool MoveNext()
{
if (this.ver != this.l.modificationCount)
{
throw new InvalidOperationException("Collection was modified after the enumerator was instantiated.");
}
if (this.idx == -2)
{
this.idx = this.l.Count;
}
return this.idx != -1 && --this.idx != -1;
}
// Token: 0x17000051 RID: 81
// (get) Token: 0x06000131 RID: 305 RVA: 0x00005F34 File Offset: 0x00004134
public TKey Current
{
get
{
if (this.idx < 0)
{
throw new InvalidOperationException();
}
return this.l.KeyAt(this.l.Count - 1 - this.idx);
}
}
// Token: 0x0400006A RID: 106
private const int NOT_STARTED = -2;
// Token: 0x0400006B RID: 107
private const int FINISHED = -1;
// Token: 0x0400006C RID: 108
private SortedList<TKey, TValue> l;
// Token: 0x0400006D RID: 109
private int idx;
// Token: 0x0400006E RID: 110
private int ver;
}
// Token: 0x02000020 RID: 32
[Serializable]
public struct ValueEnumerator : IEnumerator, IDisposable, IEnumerator<TValue>
{
// Token: 0x06000132 RID: 306 RVA: 0x00005F68 File Offset: 0x00004168
internal ValueEnumerator(SortedList<TKey, TValue> l)
{
this.l = l;
this.idx = -2;
this.ver = l.modificationCount;
}
// Token: 0x06000133 RID: 307 RVA: 0x00005F88 File Offset: 0x00004188
void IEnumerator.Reset()
{
if (this.ver != this.l.modificationCount)
{
throw new InvalidOperationException("Collection was modified after the enumerator was instantiated.");
}
this.idx = -2;
}
// Token: 0x17000052 RID: 82
// (get) Token: 0x06000134 RID: 308 RVA: 0x00005FB4 File Offset: 0x000041B4
object IEnumerator.Current
{
get
{
return this.Current;
}
}
// Token: 0x06000135 RID: 309 RVA: 0x00005FC4 File Offset: 0x000041C4
public void Dispose()
{
this.idx = -2;
}
// Token: 0x06000136 RID: 310 RVA: 0x00005FD0 File Offset: 0x000041D0
public bool MoveNext()
{
if (this.ver != this.l.modificationCount)
{
throw new InvalidOperationException("Collection was modified after the enumerator was instantiated.");
}
if (this.idx == -2)
{
this.idx = this.l.Count;
}
return this.idx != -1 && --this.idx != -1;
}
// Token: 0x17000053 RID: 83
// (get) Token: 0x06000137 RID: 311 RVA: 0x00006044 File Offset: 0x00004244
public TValue Current
{
get
{
if (this.idx < 0)
{
throw new InvalidOperationException();
}
return this.l.ValueAt(this.l.Count - 1 - this.idx);
}
}
// Token: 0x0400006F RID: 111
private const int NOT_STARTED = -2;
// Token: 0x04000070 RID: 112
private const int FINISHED = -1;
// Token: 0x04000071 RID: 113
private SortedList<TKey, TValue> l;
// Token: 0x04000072 RID: 114
private int idx;
// Token: 0x04000073 RID: 115
private int ver;
}
// Token: 0x02000021 RID: 33
private class ListKeys : ICollection, IEnumerable, IList<TKey>, ICollection<TKey>, IEnumerable<TKey>
{
// Token: 0x06000138 RID: 312 RVA: 0x00006078 File Offset: 0x00004278
public ListKeys(SortedList<TKey, TValue> host)
{
if (host == null)
{
throw new ArgumentNullException();
}
this.host = host;
}
// Token: 0x06000139 RID: 313 RVA: 0x00006094 File Offset: 0x00004294
IEnumerator IEnumerable.GetEnumerator()
{
for (int i = 0; i < this.host.Count; i++)
{
yield return this.host.KeyAt(i);
}
yield break;
}
// Token: 0x0600013A RID: 314 RVA: 0x000060B0 File Offset: 0x000042B0
public virtual void Add(TKey item)
{
throw new NotSupportedException();
}
// Token: 0x0600013B RID: 315 RVA: 0x000060B8 File Offset: 0x000042B8
public virtual bool Remove(TKey key)
{
throw new NotSupportedException();
}
// Token: 0x0600013C RID: 316 RVA: 0x000060C0 File Offset: 0x000042C0
public virtual void Clear()
{
throw new NotSupportedException();
}
// Token: 0x0600013D RID: 317 RVA: 0x000060C8 File Offset: 0x000042C8
public virtual void CopyTo(TKey[] array, int arrayIndex)
{
if (this.host.Count == 0)
{
return;
}
if (array == null)
{
throw new ArgumentNullException("array");
}
if (arrayIndex < 0)
{
throw new ArgumentOutOfRangeException();
}
if (arrayIndex >= array.Length)
{
throw new ArgumentOutOfRangeException("arrayIndex is greater than or equal to array.Length");
}
if (this.Count > array.Length - arrayIndex)
{
throw new ArgumentOutOfRangeException("Not enough space in array from arrayIndex to end of array");
}
int num = arrayIndex;
for (int i = 0; i < this.Count; i++)
{
array[num++] = this.host.KeyAt(i);
}
}
// Token: 0x0600013E RID: 318 RVA: 0x00006164 File Offset: 0x00004364
public virtual bool Contains(TKey item)
{
return this.host.IndexOfKey(item) > -1;
}
// Token: 0x0600013F RID: 319 RVA: 0x00006178 File Offset: 0x00004378
public virtual int IndexOf(TKey item)
{
return this.host.IndexOfKey(item);
}
// Token: 0x06000140 RID: 320 RVA: 0x00006188 File Offset: 0x00004388
public virtual void Insert(int index, TKey item)
{
throw new NotSupportedException();
}
// Token: 0x06000141 RID: 321 RVA: 0x00006190 File Offset: 0x00004390
public virtual void RemoveAt(int index)
{
throw new NotSupportedException();
}
// Token: 0x17000054 RID: 84
public virtual TKey this[int index]
{
get
{
return this.host.KeyAt(index);
}
set
{
throw new NotSupportedException("attempt to modify a key");
}
}
// Token: 0x06000144 RID: 324 RVA: 0x000061B4 File Offset: 0x000043B4
public virtual IEnumerator<TKey> GetEnumerator()
{
return new SortedList<TKey, TValue>.KeyEnumerator(this.host);
}
// Token: 0x17000055 RID: 85
// (get) Token: 0x06000145 RID: 325 RVA: 0x000061C8 File Offset: 0x000043C8
public virtual int Count
{
get
{
return this.host.Count;
}
}
// Token: 0x17000056 RID: 86
// (get) Token: 0x06000146 RID: 326 RVA: 0x000061D8 File Offset: 0x000043D8
public virtual bool IsSynchronized
{
get
{
return ((ICollection)this.host).IsSynchronized;
}
}
// Token: 0x17000057 RID: 87
// (get) Token: 0x06000147 RID: 327 RVA: 0x000061E8 File Offset: 0x000043E8
public virtual bool IsReadOnly
{
get
{
return true;
}
}
// Token: 0x17000058 RID: 88
// (get) Token: 0x06000148 RID: 328 RVA: 0x000061EC File Offset: 0x000043EC
public virtual object SyncRoot
{
get
{
return ((ICollection)this.host).SyncRoot;
}
}
// Token: 0x06000149 RID: 329 RVA: 0x000061FC File Offset: 0x000043FC
public virtual void CopyTo(Array array, int arrayIndex)
{
this.host.CopyToArray(array, arrayIndex, SortedList<TKey, TValue>.EnumeratorMode.KEY_MODE);
}
// Token: 0x04000074 RID: 116
private SortedList<TKey, TValue> host;
}
// Token: 0x02000022 RID: 34
private class ListValues : ICollection, IEnumerable, IList<TValue>, ICollection<TValue>, IEnumerable<TValue>
{
// Token: 0x0600014A RID: 330 RVA: 0x0000620C File Offset: 0x0000440C
public ListValues(SortedList<TKey, TValue> host)
{
if (host == null)
{
throw new ArgumentNullException();
}
this.host = host;
}
// Token: 0x0600014B RID: 331 RVA: 0x00006228 File Offset: 0x00004428
IEnumerator IEnumerable.GetEnumerator()
{
for (int i = 0; i < this.host.Count; i++)
{
yield return this.host.ValueAt(i);
}
yield break;
}
// Token: 0x0600014C RID: 332 RVA: 0x00006244 File Offset: 0x00004444
public virtual void Add(TValue item)
{
throw new NotSupportedException();
}
// Token: 0x0600014D RID: 333 RVA: 0x0000624C File Offset: 0x0000444C
public virtual bool Remove(TValue value)
{
throw new NotSupportedException();
}
// Token: 0x0600014E RID: 334 RVA: 0x00006254 File Offset: 0x00004454
public virtual void Clear()
{
throw new NotSupportedException();
}
// Token: 0x0600014F RID: 335 RVA: 0x0000625C File Offset: 0x0000445C
public virtual void CopyTo(TValue[] array, int arrayIndex)
{
if (this.host.Count == 0)
{
return;
}
if (array == null)
{
throw new ArgumentNullException("array");
}
if (arrayIndex < 0)
{
throw new ArgumentOutOfRangeException();
}
if (arrayIndex >= array.Length)
{
throw new ArgumentOutOfRangeException("arrayIndex is greater than or equal to array.Length");
}
if (this.Count > array.Length - arrayIndex)
{
throw new ArgumentOutOfRangeException("Not enough space in array from arrayIndex to end of array");
}
int num = arrayIndex;
for (int i = 0; i < this.Count; i++)
{
array[num++] = this.host.ValueAt(i);
}
}
// Token: 0x06000150 RID: 336 RVA: 0x000062F8 File Offset: 0x000044F8
public virtual bool Contains(TValue item)
{
return this.host.IndexOfValue(item) > -1;
}
// Token: 0x06000151 RID: 337 RVA: 0x0000630C File Offset: 0x0000450C
public virtual int IndexOf(TValue item)
{
return this.host.IndexOfValue(item);
}
// Token: 0x06000152 RID: 338 RVA: 0x0000631C File Offset: 0x0000451C
public virtual void Insert(int index, TValue item)
{
throw new NotSupportedException();
}
// Token: 0x06000153 RID: 339 RVA: 0x00006324 File Offset: 0x00004524
public virtual void RemoveAt(int index)
{
throw new NotSupportedException();
}
// Token: 0x17000059 RID: 89
public virtual TValue this[int index]
{
get
{
return this.host.ValueAt(index);
}
set
{
throw new NotSupportedException("attempt to modify a key");
}
}
// Token: 0x06000156 RID: 342 RVA: 0x00006348 File Offset: 0x00004548
public virtual IEnumerator<TValue> GetEnumerator()
{
return new SortedList<TKey, TValue>.ValueEnumerator(this.host);
}
// Token: 0x1700005A RID: 90
// (get) Token: 0x06000157 RID: 343 RVA: 0x0000635C File Offset: 0x0000455C
public virtual int Count
{
get
{
return this.host.Count;
}
}
// Token: 0x1700005B RID: 91
// (get) Token: 0x06000158 RID: 344 RVA: 0x0000636C File Offset: 0x0000456C
public virtual bool IsSynchronized
{
get
{
return ((ICollection)this.host).IsSynchronized;
}
}
// Token: 0x1700005C RID: 92
// (get) Token: 0x06000159 RID: 345 RVA: 0x0000637C File Offset: 0x0000457C
public virtual bool IsReadOnly
{
get
{
return true;
}
}
// Token: 0x1700005D RID: 93
// (get) Token: 0x0600015A RID: 346 RVA: 0x00006380 File Offset: 0x00004580
public virtual object SyncRoot
{
get
{
return ((ICollection)this.host).SyncRoot;
}
}
// Token: 0x0600015B RID: 347 RVA: 0x00006390 File Offset: 0x00004590
public virtual void CopyTo(Array array, int arrayIndex)
{
this.host.CopyToArray(array, arrayIndex, SortedList<TKey, TValue>.EnumeratorMode.VALUE_MODE);
}
// Token: 0x04000075 RID: 117
private SortedList<TKey, TValue> host;
}
}
}
+363
View File
@@ -0,0 +1,363 @@
using System;
using System.Runtime.InteropServices;
namespace System.Collections.Generic
{
/// <summary>Represents a variable size last-in-first-out (LIFO) collection of instances of the same arbitrary type.</summary>
/// <typeparam name="T">Specifies the type of elements in the stack.</typeparam>
/// <filterpriority>1</filterpriority>
// Token: 0x02000023 RID: 35
[ComVisible(false)]
[Serializable]
public class Stack<T> : ICollection, IEnumerable, IEnumerable<T>
{
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Stack`1" /> class that is empty and has the default initial capacity.</summary>
// Token: 0x0600015C RID: 348 RVA: 0x000063A0 File Offset: 0x000045A0
public Stack()
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Stack`1" /> class that is empty and has the specified initial capacity or the default initial capacity, whichever is greater.</summary>
/// <param name="capacity">The initial number of elements that the <see cref="T:System.Collections.Generic.Stack`1" /> can contain.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="capacity" /> is less than zero.</exception>
// Token: 0x0600015D RID: 349 RVA: 0x000063A8 File Offset: 0x000045A8
public Stack(int count)
{
if (count < 0)
{
throw new ArgumentOutOfRangeException("count");
}
this._array = new T[count];
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Stack`1" /> class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied.</summary>
/// <param name="collection">The collection to copy elements from.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="collection" /> is null.</exception>
// Token: 0x0600015E RID: 350 RVA: 0x000063DC File Offset: 0x000045DC
public Stack(IEnumerable<T> collection)
{
if (collection == null)
{
throw new ArgumentNullException("collection");
}
ICollection<T> collection2 = collection as ICollection<T>;
if (collection2 != null)
{
this._size = collection2.Count;
this._array = new T[this._size];
collection2.CopyTo(this._array, 0);
}
else
{
foreach (T t in collection)
{
this.Push(t);
}
}
}
/// <summary>Gets a value indicating whether access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe).</summary>
/// <returns>true if access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe); otherwise, false. In the default implementation of <see cref="T:System.Collections.Generic.Stack`1" />, this property always returns false.</returns>
// Token: 0x1700005E RID: 94
// (get) Token: 0x0600015F RID: 351 RVA: 0x00006490 File Offset: 0x00004690
bool ICollection.IsSynchronized
{
get
{
return false;
}
}
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />.</summary>
/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />. In the default implementation of <see cref="T:System.Collections.Generic.Stack`1" />, this property always returns the current instance.</returns>
// Token: 0x1700005F RID: 95
// (get) Token: 0x06000160 RID: 352 RVA: 0x00006494 File Offset: 0x00004694
object ICollection.SyncRoot
{
get
{
return this;
}
}
/// <summary>Copies the elements of the <see cref="T:System.Collections.ICollection" /> to an <see cref="T:System.Array" />, starting at a particular <see cref="T:System.Array" /> index.</summary>
/// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from <see cref="T:System.Collections.ICollection" />. The <see cref="T:System.Array" /> must have zero-based indexing.</param>
/// <param name="arrayIndex">The zero-based index in <paramref name="array" /> at which copying begins.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="arrayIndex" /> is less than zero.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or-<paramref name="array" /> does not have zero-based indexing.-or-The number of elements in the source <see cref="T:System.Collections.ICollection" /> is greater than the available space from <paramref name="arrayIndex" /> to the end of the destination <paramref name="array" />.-or-The type of the source <see cref="T:System.Collections.ICollection" /> cannot be cast automatically to the type of the destination <paramref name="array" />.</exception>
// Token: 0x06000161 RID: 353 RVA: 0x00006498 File Offset: 0x00004698
void ICollection.CopyTo(Array dest, int idx)
{
try
{
if (this._array != null)
{
this._array.CopyTo(dest, idx);
Array.Reverse(dest, idx, this._size);
}
}
catch (ArrayTypeMismatchException)
{
throw new ArgumentException();
}
}
// Token: 0x06000162 RID: 354 RVA: 0x000064F8 File Offset: 0x000046F8
IEnumerator<T> IEnumerable<T>.GetEnumerator()
{
return this.GetEnumerator();
}
/// <summary>Returns an enumerator that iterates through a collection.</summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> that can be used to iterate through the collection.</returns>
// Token: 0x06000163 RID: 355 RVA: 0x00006508 File Offset: 0x00004708
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
/// <summary>Removes all objects from the <see cref="T:System.Collections.Generic.Stack`1" />.</summary>
/// <filterpriority>1</filterpriority>
// Token: 0x06000164 RID: 356 RVA: 0x00006518 File Offset: 0x00004718
public void Clear()
{
if (this._array != null)
{
Array.Clear(this._array, 0, this._array.Length);
}
this._size = 0;
this._version++;
}
/// <summary>Determines whether an element is in the <see cref="T:System.Collections.Generic.Stack`1" />.</summary>
/// <returns>true if <paramref name="item" /> is found in the <see cref="T:System.Collections.Generic.Stack`1" />; otherwise, false.</returns>
/// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.Stack`1" />. The value can be null for reference types.</param>
// Token: 0x06000165 RID: 357 RVA: 0x0000655C File Offset: 0x0000475C
public bool Contains(T t)
{
return this._array != null && Array.IndexOf<T>(this._array, t, 0, this._size) != -1;
}
/// <summary>Copies the <see cref="T:System.Collections.Generic.Stack`1" /> to an existing one-dimensional <see cref="T:System.Array" />, starting at the specified array index.</summary>
/// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from <see cref="T:System.Collections.Generic.Stack`1" />. The <see cref="T:System.Array" /> must have zero-based indexing.</param>
/// <param name="arrayIndex">The zero-based index in <paramref name="array" /> at which copying begins.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="arrayIndex" /> is less than zero.</exception>
/// <exception cref="T:System.ArgumentException">The number of elements in the source <see cref="T:System.Collections.Generic.Stack`1" /> is greater than the available space from <paramref name="arrayIndex" /> to the end of the destination <paramref name="array" />.</exception>
// Token: 0x06000166 RID: 358 RVA: 0x00006588 File Offset: 0x00004788
public void CopyTo(T[] dest, int idx)
{
if (dest == null)
{
throw new ArgumentNullException("dest");
}
if (idx < 0)
{
throw new ArgumentOutOfRangeException("idx");
}
if (this._array != null)
{
Array.Copy(this._array, 0, dest, idx, this._size);
Array.Reverse(dest, idx, this._size);
}
}
/// <summary>Returns the object at the top of the <see cref="T:System.Collections.Generic.Stack`1" /> without removing it.</summary>
/// <returns>The object at the top of the <see cref="T:System.Collections.Generic.Stack`1" />.</returns>
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Collections.Generic.Stack`1" /> is empty.</exception>
// Token: 0x06000167 RID: 359 RVA: 0x000065E4 File Offset: 0x000047E4
public T Peek()
{
if (this._size == 0)
{
throw new InvalidOperationException();
}
return this._array[this._size - 1];
}
/// <summary>Removes and returns the object at the top of the <see cref="T:System.Collections.Generic.Stack`1" />.</summary>
/// <returns>The object removed from the top of the <see cref="T:System.Collections.Generic.Stack`1" />.</returns>
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Collections.Generic.Stack`1" /> is empty.</exception>
// Token: 0x06000168 RID: 360 RVA: 0x00006618 File Offset: 0x00004818
public T Pop()
{
if (this._size == 0)
{
throw new InvalidOperationException();
}
this._version++;
T t = this._array[--this._size];
this._array[this._size] = default(T);
return t;
}
/// <summary>Inserts an object at the top of the <see cref="T:System.Collections.Generic.Stack`1" />.</summary>
/// <param name="item">The object to push onto the <see cref="T:System.Collections.Generic.Stack`1" />. The value can be null for reference types.</param>
// Token: 0x06000169 RID: 361 RVA: 0x0000667C File Offset: 0x0000487C
public void Push(T t)
{
if (this._array == null || this._size == this._array.Length)
{
Array.Resize<T>(ref this._array, (this._size != 0) ? (2 * this._size) : 16);
}
this._version++;
this._array[this._size++] = t;
}
/// <summary>Copies the <see cref="T:System.Collections.Generic.Stack`1" /> to a new array.</summary>
/// <returns>A new array containing copies of the elements of the <see cref="T:System.Collections.Generic.Stack`1" />.</returns>
// Token: 0x0600016A RID: 362 RVA: 0x000066F8 File Offset: 0x000048F8
public T[] ToArray()
{
T[] array = new T[this._size];
this.CopyTo(array, 0);
return array;
}
/// <summary>Sets the capacity to the actual number of elements in the <see cref="T:System.Collections.Generic.Stack`1" />, if that number is less than 90 percent of current capacity.</summary>
// Token: 0x0600016B RID: 363 RVA: 0x0000671C File Offset: 0x0000491C
public void TrimExcess()
{
if (this._array != null && (double)this._size < (double)this._array.Length * 0.9)
{
Array.Resize<T>(ref this._array, this._size);
}
this._version++;
}
/// <summary>Gets the number of elements contained in the <see cref="T:System.Collections.Generic.Stack`1" />.</summary>
/// <returns>The number of elements contained in the <see cref="T:System.Collections.Generic.Stack`1" />.</returns>
// Token: 0x17000060 RID: 96
// (get) Token: 0x0600016C RID: 364 RVA: 0x00006774 File Offset: 0x00004974
public int Count
{
get
{
return this._size;
}
}
/// <summary>Returns an enumerator for the <see cref="T:System.Collections.Generic.Stack`1" />.</summary>
/// <returns>An <see cref="T:System.Collections.Generic.Stack`1.Enumerator" /> for the <see cref="T:System.Collections.Generic.Stack`1" />.</returns>
// Token: 0x0600016D RID: 365 RVA: 0x0000677C File Offset: 0x0000497C
public Stack<T>.Enumerator GetEnumerator()
{
return new Stack<T>.Enumerator(this);
}
// Token: 0x04000076 RID: 118
private const int INITIAL_SIZE = 16;
// Token: 0x04000077 RID: 119
private T[] _array;
// Token: 0x04000078 RID: 120
private int _size;
// Token: 0x04000079 RID: 121
private int _version;
/// <summary>Enumerates the elements of a <see cref="T:System.Collections.Generic.Stack`1" />.</summary>
// Token: 0x02000024 RID: 36
[Serializable]
public struct Enumerator : IEnumerator, IDisposable, IEnumerator<T>
{
// Token: 0x0600016E RID: 366 RVA: 0x00006784 File Offset: 0x00004984
internal Enumerator(Stack<T> t)
{
this.parent = t;
this.idx = -2;
this._version = t._version;
}
/// <summary>Sets the enumerator to its initial position, which is before the first element in the collection. This class cannot be inherited.</summary>
/// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
// Token: 0x0600016F RID: 367 RVA: 0x000067A4 File Offset: 0x000049A4
void IEnumerator.Reset()
{
if (this._version != this.parent._version)
{
throw new InvalidOperationException();
}
this.idx = -2;
}
/// <summary>Gets the element at the current position of the enumerator.</summary>
/// <returns>The element in the collection at the current position of the enumerator.</returns>
/// <exception cref="T:System.InvalidOperationException">The enumerator is positioned before the first element of the collection or after the last element. </exception>
// Token: 0x17000061 RID: 97
// (get) Token: 0x06000170 RID: 368 RVA: 0x000067D8 File Offset: 0x000049D8
object IEnumerator.Current
{
get
{
return this.Current;
}
}
/// <summary>Releases all resources used by the <see cref="T:System.Collections.Generic.Stack`1.Enumerator" />.</summary>
// Token: 0x06000171 RID: 369 RVA: 0x000067E8 File Offset: 0x000049E8
public void Dispose()
{
this.idx = -2;
}
/// <summary>Advances the enumerator to the next element of the <see cref="T:System.Collections.Generic.Stack`1" />.</summary>
/// <returns>true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.</returns>
/// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
// Token: 0x06000172 RID: 370 RVA: 0x000067F4 File Offset: 0x000049F4
public bool MoveNext()
{
if (this._version != this.parent._version)
{
throw new InvalidOperationException();
}
if (this.idx == -2)
{
this.idx = this.parent._size;
}
return this.idx != -1 && --this.idx != -1;
}
/// <summary>Gets the element at the current position of the enumerator.</summary>
/// <returns>The element in the <see cref="T:System.Collections.Generic.Stack`1" /> at the current position of the enumerator.</returns>
/// <exception cref="T:System.InvalidOperationException">The enumerator is positioned before the first element of the collection or after the last element. </exception>
// Token: 0x17000062 RID: 98
// (get) Token: 0x06000173 RID: 371 RVA: 0x00006864 File Offset: 0x00004A64
public T Current
{
get
{
if (this.idx < 0)
{
throw new InvalidOperationException();
}
return this.parent._array[this.idx];
}
}
// Token: 0x0400007A RID: 122
private const int NOT_STARTED = -2;
// Token: 0x0400007B RID: 123
private const int FINISHED = -1;
// Token: 0x0400007C RID: 124
private Stack<T> parent;
// Token: 0x0400007D RID: 125
private int idx;
// Token: 0x0400007E RID: 126
private int _version;
}
}
}
@@ -0,0 +1,323 @@
using System;
using System.Text;
namespace System.Collections.Specialized
{
/// <summary>Provides a simple structure that stores Boolean values and small integers in 32 bits of memory.</summary>
// Token: 0x02000025 RID: 37
public struct BitVector32
{
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.BitVector32" /> structure containing the data represented in an existing <see cref="T:System.Collections.Specialized.BitVector32" /> structure.</summary>
/// <param name="value">A <see cref="T:System.Collections.Specialized.BitVector32" /> structure that contains the data to copy. </param>
// Token: 0x06000174 RID: 372 RVA: 0x0000689C File Offset: 0x00004A9C
public BitVector32(BitVector32 source)
{
this.bits = source.bits;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.BitVector32" /> structure containing the data represented in an integer.</summary>
/// <param name="data">An integer representing the data of the new <see cref="T:System.Collections.Specialized.BitVector32" />. </param>
// Token: 0x06000175 RID: 373 RVA: 0x000068AC File Offset: 0x00004AAC
public BitVector32(int init)
{
this.bits = init;
}
/// <summary>Gets the value of the <see cref="T:System.Collections.Specialized.BitVector32" /> as an integer.</summary>
/// <returns>The value of the <see cref="T:System.Collections.Specialized.BitVector32" /> as an integer.</returns>
// Token: 0x17000063 RID: 99
// (get) Token: 0x06000176 RID: 374 RVA: 0x000068B8 File Offset: 0x00004AB8
public int Data
{
get
{
return this.bits;
}
}
/// <summary>Gets or sets the value stored in the specified <see cref="T:System.Collections.Specialized.BitVector32.Section" />.</summary>
/// <returns>The value stored in the specified <see cref="T:System.Collections.Specialized.BitVector32.Section" />.</returns>
/// <param name="section">A <see cref="T:System.Collections.Specialized.BitVector32.Section" /> that contains the value to get or set. </param>
// Token: 0x17000064 RID: 100
public int this[BitVector32.Section section]
{
get
{
return (this.bits >> (int)section.Offset) & (int)section.Mask;
}
set
{
if (value < 0)
{
throw new ArgumentException("Section can't hold negative values");
}
if (value > (int)section.Mask)
{
throw new ArgumentException("Value too large to fit in section");
}
this.bits &= ~((int)section.Mask << (int)section.Offset);
this.bits |= value << (int)section.Offset;
}
}
/// <summary>Gets or sets the state of the bit flag indicated by the specified mask.</summary>
/// <returns>true if the specified bit flag is on (1); otherwise, false.</returns>
/// <param name="bit">A mask that indicates the bit to get or set. </param>
// Token: 0x17000065 RID: 101
public bool this[int mask]
{
get
{
return (this.bits & mask) == mask;
}
set
{
if (value)
{
this.bits |= mask;
}
else
{
this.bits &= ~mask;
}
}
}
/// <summary>Creates the first mask in a series of masks that can be used to retrieve individual bits in a <see cref="T:System.Collections.Specialized.BitVector32" /> that is set up as bit flags.</summary>
/// <returns>A mask that isolates the first bit flag in the <see cref="T:System.Collections.Specialized.BitVector32" />.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x0600017B RID: 379 RVA: 0x0000699C File Offset: 0x00004B9C
public static int CreateMask()
{
return 1;
}
/// <summary>Creates an additional mask following the specified mask in a series of masks that can be used to retrieve individual bits in a <see cref="T:System.Collections.Specialized.BitVector32" /> that is set up as bit flags.</summary>
/// <returns>A mask that isolates the bit flag following the one that <paramref name="previous" /> points to in <see cref="T:System.Collections.Specialized.BitVector32" />.</returns>
/// <param name="previous">The mask that indicates the previous bit flag. </param>
/// <exception cref="T:System.InvalidOperationException">
/// <paramref name="previous" /> indicates the last bit flag in the <see cref="T:System.Collections.Specialized.BitVector32" />. </exception>
// Token: 0x0600017C RID: 380 RVA: 0x000069A0 File Offset: 0x00004BA0
public static int CreateMask(int prev)
{
if (prev == 0)
{
return 1;
}
if (prev == -2147483648)
{
throw new InvalidOperationException("all bits set");
}
return prev << 1;
}
/// <summary>Creates the first <see cref="T:System.Collections.Specialized.BitVector32.Section" /> in a series of sections that contain small integers.</summary>
/// <returns>A <see cref="T:System.Collections.Specialized.BitVector32.Section" /> that can hold a number from zero to <paramref name="maxValue" />.</returns>
/// <param name="maxValue">A 16-bit signed integer that specifies the maximum value for the new <see cref="T:System.Collections.Specialized.BitVector32.Section" />. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="maxValue" /> is less than 1. </exception>
// Token: 0x0600017D RID: 381 RVA: 0x000069C4 File Offset: 0x00004BC4
public static BitVector32.Section CreateSection(short maxValue)
{
return BitVector32.CreateSection(maxValue, new BitVector32.Section(0, 0));
}
/// <summary>Creates a new <see cref="T:System.Collections.Specialized.BitVector32.Section" /> following the specified <see cref="T:System.Collections.Specialized.BitVector32.Section" /> in a series of sections that contain small integers.</summary>
/// <returns>A <see cref="T:System.Collections.Specialized.BitVector32.Section" /> that can hold a number from zero to <paramref name="maxValue" />.</returns>
/// <param name="maxValue">A 16-bit signed integer that specifies the maximum value for the new <see cref="T:System.Collections.Specialized.BitVector32.Section" />. </param>
/// <param name="previous">The previous <see cref="T:System.Collections.Specialized.BitVector32.Section" /> in the <see cref="T:System.Collections.Specialized.BitVector32" />. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="maxValue" /> is less than 1. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <paramref name="previous" /> includes the final bit in the <see cref="T:System.Collections.Specialized.BitVector32" />.-or- <paramref name="maxValue" /> is greater than the highest value that can be represented by the number of bits after <paramref name="previous" />. </exception>
// Token: 0x0600017E RID: 382 RVA: 0x000069D4 File Offset: 0x00004BD4
public static BitVector32.Section CreateSection(short maxValue, BitVector32.Section previous)
{
if (maxValue < 1)
{
throw new ArgumentException("maxValue");
}
int num = BitVector32.HighestSetBit((int)maxValue);
int num2 = (1 << num) - 1;
int num3 = (int)previous.Offset + BitVector32.HighestSetBit((int)previous.Mask);
if (num3 + num > 32)
{
throw new ArgumentException("Sections cannot exceed 32 bits in total");
}
return new BitVector32.Section((short)num2, (short)num3);
}
/// <summary>Determines whether the specified object is equal to the <see cref="T:System.Collections.Specialized.BitVector32" />.</summary>
/// <returns>true if the specified object is equal to the <see cref="T:System.Collections.Specialized.BitVector32" />; otherwise, false.</returns>
/// <param name="o">The object to compare with the current <see cref="T:System.Collections.Specialized.BitVector32" />. </param>
// Token: 0x0600017F RID: 383 RVA: 0x00006A38 File Offset: 0x00004C38
public override bool Equals(object o)
{
return o is BitVector32 && this.bits == ((BitVector32)o).bits;
}
/// <summary>Serves as a hash function for the <see cref="T:System.Collections.Specialized.BitVector32" />.</summary>
/// <returns>A hash code for the <see cref="T:System.Collections.Specialized.BitVector32" />.</returns>
// Token: 0x06000180 RID: 384 RVA: 0x00006A6C File Offset: 0x00004C6C
public override int GetHashCode()
{
return this.bits.GetHashCode();
}
/// <summary>Returns a string that represents the current <see cref="T:System.Collections.Specialized.BitVector32" />.</summary>
/// <returns>A string that represents the current <see cref="T:System.Collections.Specialized.BitVector32" />.</returns>
// Token: 0x06000181 RID: 385 RVA: 0x00006A7C File Offset: 0x00004C7C
public override string ToString()
{
return BitVector32.ToString(this);
}
/// <summary>Returns a string that represents the specified <see cref="T:System.Collections.Specialized.BitVector32" />.</summary>
/// <returns>A string that represents the specified <see cref="T:System.Collections.Specialized.BitVector32" />.</returns>
/// <param name="value">The <see cref="T:System.Collections.Specialized.BitVector32" /> to represent. </param>
// Token: 0x06000182 RID: 386 RVA: 0x00006A8C File Offset: 0x00004C8C
public static string ToString(BitVector32 value)
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append("BitVector32{");
for (long num = (long)((ulong)int.MinValue); num > 0L; num >>= 1)
{
stringBuilder.Append((((long)value.bits & num) != 0L) ? '1' : '0');
}
stringBuilder.Append('}');
return stringBuilder.ToString();
}
// Token: 0x06000183 RID: 387 RVA: 0x00006AF4 File Offset: 0x00004CF4
private static int HighestSetBit(int i)
{
int num = 0;
while (i >> num != 0)
{
num++;
}
return num;
}
// Token: 0x0400007F RID: 127
private int bits;
/// <summary>Represents a section of the vector that can contain an integer number.</summary>
// Token: 0x02000026 RID: 38
public struct Section
{
// Token: 0x06000184 RID: 388 RVA: 0x00006B18 File Offset: 0x00004D18
internal Section(short mask, short offset)
{
this.mask = mask;
this.offset = offset;
}
/// <summary>Gets a mask that isolates this section within the <see cref="T:System.Collections.Specialized.BitVector32" />.</summary>
/// <returns>A mask that isolates this section within the <see cref="T:System.Collections.Specialized.BitVector32" />.</returns>
// Token: 0x17000066 RID: 102
// (get) Token: 0x06000185 RID: 389 RVA: 0x00006B28 File Offset: 0x00004D28
public short Mask
{
get
{
return this.mask;
}
}
/// <summary>Gets the offset of this section from the start of the <see cref="T:System.Collections.Specialized.BitVector32" />.</summary>
/// <returns>The offset of this section from the start of the <see cref="T:System.Collections.Specialized.BitVector32" />.</returns>
// Token: 0x17000067 RID: 103
// (get) Token: 0x06000186 RID: 390 RVA: 0x00006B30 File Offset: 0x00004D30
public short Offset
{
get
{
return this.offset;
}
}
/// <summary>Determines whether the specified <see cref="T:System.Collections.Specialized.BitVector32.Section" /> object is the same as the current <see cref="T:System.Collections.Specialized.BitVector32.Section" /> object.</summary>
/// <returns>true if the <paramref name="obj" /> parameter is the same as the current <see cref="T:System.Collections.Specialized.BitVector32.Section" /> object; otherwise false.</returns>
/// <param name="obj">The <see cref="T:System.Collections.Specialized.BitVector32.Section" /> object to compare with the current <see cref="T:System.Collections.Specialized.BitVector32.Section" /> object.</param>
// Token: 0x06000187 RID: 391 RVA: 0x00006B38 File Offset: 0x00004D38
public bool Equals(BitVector32.Section obj)
{
return this.mask == obj.mask && this.offset == obj.offset;
}
/// <summary>Determines whether the specified object is the same as the current <see cref="T:System.Collections.Specialized.BitVector32.Section" /> object.</summary>
/// <returns>true if the specified object is the same as the current <see cref="T:System.Collections.Specialized.BitVector32.Section" /> object; otherwise, false.</returns>
/// <param name="o">The object to compare with the current <see cref="T:System.Collections.Specialized.BitVector32.Section" />.</param>
// Token: 0x06000188 RID: 392 RVA: 0x00006B6C File Offset: 0x00004D6C
public override bool Equals(object o)
{
if (!(o is BitVector32.Section))
{
return false;
}
BitVector32.Section section = (BitVector32.Section)o;
return this.mask == section.mask && this.offset == section.offset;
}
/// <summary>Serves as a hash function for the current <see cref="T:System.Collections.Specialized.BitVector32.Section" />, suitable for hashing algorithms and data structures, such as a hash table.</summary>
/// <returns>A hash code for the current <see cref="T:System.Collections.Specialized.BitVector32.Section" />.</returns>
// Token: 0x06000189 RID: 393 RVA: 0x00006BB4 File Offset: 0x00004DB4
public override int GetHashCode()
{
return (int)this.mask << (int)this.offset;
}
/// <summary>Returns a string that represents the current <see cref="T:System.Collections.Specialized.BitVector32.Section" />.</summary>
/// <returns>A string that represents the current <see cref="T:System.Collections.Specialized.BitVector32.Section" />.</returns>
// Token: 0x0600018A RID: 394 RVA: 0x00006BC8 File Offset: 0x00004DC8
public override string ToString()
{
return BitVector32.Section.ToString(this);
}
/// <summary>Returns a string that represents the specified <see cref="T:System.Collections.Specialized.BitVector32.Section" />.</summary>
/// <returns>A string that represents the specified <see cref="T:System.Collections.Specialized.BitVector32.Section" />.</returns>
/// <param name="value">The <see cref="T:System.Collections.Specialized.BitVector32.Section" /> to represent.</param>
// Token: 0x0600018B RID: 395 RVA: 0x00006BD8 File Offset: 0x00004DD8
public static string ToString(BitVector32.Section value)
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append("Section{0x");
stringBuilder.Append(Convert.ToString(value.Mask, 16));
stringBuilder.Append(", 0x");
stringBuilder.Append(Convert.ToString(value.Offset, 16));
stringBuilder.Append("}");
return stringBuilder.ToString();
}
/// <summary>Determines whether two specified <see cref="T:System.Collections.Specialized.BitVector32.Section" /> objects are equal.</summary>
/// <returns>true if the <paramref name="a" /> and <paramref name="b" /> parameters represent the same <see cref="T:System.Collections.Specialized.BitVector32.Section" /> object, otherwise, false.</returns>
/// <param name="a">A <see cref="T:System.Collections.Specialized.BitVector32.Section" /> object.</param>
/// <param name="b">A <see cref="T:System.Collections.Specialized.BitVector32.Section" /> object.</param>
// Token: 0x0600018C RID: 396 RVA: 0x00006C40 File Offset: 0x00004E40
public static bool operator ==(BitVector32.Section v1, BitVector32.Section v2)
{
return v1.mask == v2.mask && v1.offset == v2.offset;
}
/// <summary>Determines whether two <see cref="T:System.Collections.Specialized.BitVector32.Section" /> objects have different values.</summary>
/// <returns>true if the <paramref name="a" /> and <paramref name="b" /> parameters represent different <see cref="T:System.Collections.Specialized.BitVector32.Section" /> objects; otherwise, false.</returns>
/// <param name="a">A <see cref="T:System.Collections.Specialized.BitVector32.Section" /> object.</param>
/// <param name="b">A <see cref="T:System.Collections.Specialized.BitVector32.Section" /> object.</param>
// Token: 0x0600018D RID: 397 RVA: 0x00006C74 File Offset: 0x00004E74
public static bool operator !=(BitVector32.Section v1, BitVector32.Section v2)
{
return v1.mask != v2.mask || v1.offset != v2.offset;
}
// Token: 0x04000080 RID: 128
private short mask;
// Token: 0x04000081 RID: 129
private short offset;
}
}
}
@@ -0,0 +1,50 @@
using System;
namespace System.Collections.Specialized
{
/// <summary>Creates collections that ignore the case in strings.</summary>
// Token: 0x02000027 RID: 39
internal class CollectionsUtil
{
/// <summary>Creates a new case-insensitive instance of the <see cref="T:System.Collections.Hashtable" /> class with the default initial capacity.</summary>
/// <returns>A new case-insensitive instance of the <see cref="T:System.Collections.Hashtable" /> class with the default initial capacity.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x0600018F RID: 399 RVA: 0x00006CA8 File Offset: 0x00004EA8
public static Hashtable CreateCaseInsensitiveHashtable()
{
return new Hashtable(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
}
/// <summary>Copies the entries from the specified dictionary to a new case-insensitive instance of the <see cref="T:System.Collections.Hashtable" /> class with the same initial capacity as the number of entries copied.</summary>
/// <returns>A new case-insensitive instance of the <see cref="T:System.Collections.Hashtable" /> class containing the entries from the specified <see cref="T:System.Collections.IDictionary" />.</returns>
/// <param name="d">The <see cref="T:System.Collections.IDictionary" /> to copy to a new case-insensitive <see cref="T:System.Collections.Hashtable" />. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="d" /> is null. </exception>
// Token: 0x06000190 RID: 400 RVA: 0x00006CBC File Offset: 0x00004EBC
public static Hashtable CreateCaseInsensitiveHashtable(IDictionary d)
{
return new Hashtable(d, CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
}
/// <summary>Creates a new case-insensitive instance of the <see cref="T:System.Collections.Hashtable" /> class with the specified initial capacity.</summary>
/// <returns>A new case-insensitive instance of the <see cref="T:System.Collections.Hashtable" /> class with the specified initial capacity.</returns>
/// <param name="capacity">The approximate number of entries that the <see cref="T:System.Collections.Hashtable" /> can initially contain. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="capacity" /> is less than zero. </exception>
// Token: 0x06000191 RID: 401 RVA: 0x00006CD0 File Offset: 0x00004ED0
public static Hashtable CreateCaseInsensitiveHashtable(int capacity)
{
return new Hashtable(capacity, CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
}
/// <summary>Creates a new instance of the <see cref="T:System.Collections.SortedList" /> class that ignores the case of strings.</summary>
/// <returns>A new instance of the <see cref="T:System.Collections.SortedList" /> class that ignores the case of strings.</returns>
// Token: 0x06000192 RID: 402 RVA: 0x00006CE4 File Offset: 0x00004EE4
public static SortedList CreateCaseInsensitiveSortedList()
{
return new SortedList(CaseInsensitiveComparer.Default);
}
}
}
@@ -0,0 +1,276 @@
using System;
namespace System.Collections.Specialized
{
/// <summary>Implements IDictionary by using a <see cref="T:System.Collections.Specialized.ListDictionary" /> while the collection is small, and then switching to a <see cref="T:System.Collections.Hashtable" /> when the collection gets large.</summary>
// Token: 0x02000028 RID: 40
[Serializable]
public class HybridDictionary : ICollection, IDictionary, IEnumerable
{
/// <summary>Creates an empty case-sensitive <see cref="T:System.Collections.Specialized.HybridDictionary" />.</summary>
// Token: 0x06000193 RID: 403 RVA: 0x00006CF0 File Offset: 0x00004EF0
public HybridDictionary()
: this(0, false)
{
}
/// <summary>Creates an empty <see cref="T:System.Collections.Specialized.HybridDictionary" /> with the specified case sensitivity.</summary>
/// <param name="caseInsensitive">A Boolean that denotes whether the <see cref="T:System.Collections.Specialized.HybridDictionary" /> is case-insensitive. </param>
// Token: 0x06000194 RID: 404 RVA: 0x00006CFC File Offset: 0x00004EFC
public HybridDictionary(bool caseInsensitive)
: this(0, caseInsensitive)
{
}
/// <summary>Creates a case-sensitive <see cref="T:System.Collections.Specialized.HybridDictionary" /> with the specified initial size.</summary>
/// <param name="initialSize">The approximate number of entries that the <see cref="T:System.Collections.Specialized.HybridDictionary" /> can initially contain. </param>
// Token: 0x06000195 RID: 405 RVA: 0x00006D08 File Offset: 0x00004F08
public HybridDictionary(int initialSize)
: this(initialSize, false)
{
}
/// <summary>Creates a <see cref="T:System.Collections.Specialized.HybridDictionary" /> with the specified initial size and case sensitivity.</summary>
/// <param name="initialSize">The approximate number of entries that the <see cref="T:System.Collections.Specialized.HybridDictionary" /> can initially contain. </param>
/// <param name="caseInsensitive">A Boolean that denotes whether the <see cref="T:System.Collections.Specialized.HybridDictionary" /> is case-insensitive. </param>
// Token: 0x06000196 RID: 406 RVA: 0x00006D14 File Offset: 0x00004F14
public HybridDictionary(int initialSize, bool caseInsensitive)
{
this.caseInsensitive = caseInsensitive;
IComparer comparer = ((!caseInsensitive) ? null : CaseInsensitiveComparer.DefaultInvariant);
IHashCodeProvider hashCodeProvider = ((!caseInsensitive) ? null : CaseInsensitiveHashCodeProvider.DefaultInvariant);
if (initialSize <= 10)
{
this.list = new ListDictionary(comparer);
}
else
{
this.hashtable = new Hashtable(initialSize, hashCodeProvider, comparer);
}
}
/// <summary>Returns an <see cref="T:System.Collections.IEnumerator" /> that iterates through the <see cref="T:System.Collections.Specialized.HybridDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:System.Collections.Specialized.HybridDictionary" />.</returns>
// Token: 0x06000197 RID: 407 RVA: 0x00006D7C File Offset: 0x00004F7C
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
// Token: 0x17000068 RID: 104
// (get) Token: 0x06000198 RID: 408 RVA: 0x00006D84 File Offset: 0x00004F84
private IDictionary inner
{
get
{
IDictionary dictionary2;
if (this.list == null)
{
IDictionary dictionary = this.hashtable;
dictionary2 = dictionary;
}
else
{
dictionary2 = this.list;
}
return dictionary2;
}
}
/// <summary>Gets the number of key/value pairs contained in the <see cref="T:System.Collections.Specialized.HybridDictionary" />.</summary>
/// <returns>The number of key/value pairs contained in the <see cref="T:System.Collections.Specialized.HybridDictionary" />.Retrieving the value of this property is an O(1) operation.</returns>
// Token: 0x17000069 RID: 105
// (get) Token: 0x06000199 RID: 409 RVA: 0x00006DB0 File Offset: 0x00004FB0
public int Count
{
get
{
return this.inner.Count;
}
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.Specialized.HybridDictionary" /> has a fixed size.</summary>
/// <returns>This property always returns false.</returns>
// Token: 0x1700006A RID: 106
// (get) Token: 0x0600019A RID: 410 RVA: 0x00006DC0 File Offset: 0x00004FC0
public bool IsFixedSize
{
get
{
return false;
}
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.Specialized.HybridDictionary" /> is read-only.</summary>
/// <returns>This property always returns false.</returns>
// Token: 0x1700006B RID: 107
// (get) Token: 0x0600019B RID: 411 RVA: 0x00006DC4 File Offset: 0x00004FC4
public bool IsReadOnly
{
get
{
return false;
}
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.Specialized.HybridDictionary" /> is synchronized (thread safe).</summary>
/// <returns>This property always returns false.</returns>
// Token: 0x1700006C RID: 108
// (get) Token: 0x0600019C RID: 412 RVA: 0x00006DC8 File Offset: 0x00004FC8
public bool IsSynchronized
{
get
{
return false;
}
}
/// <summary>Gets or sets the value associated with the specified key.</summary>
/// <returns>The value associated with the specified key. If the specified key is not found, attempting to get it returns null, and attempting to set it creates a new entry using the specified key.</returns>
/// <param name="key">The key whose value to get or set. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null. </exception>
// Token: 0x1700006D RID: 109
public object this[object key]
{
get
{
return this.inner[key];
}
set
{
this.inner[key] = value;
if (this.list != null && this.Count > 10)
{
this.Switch();
}
}
}
/// <summary>Gets an <see cref="T:System.Collections.ICollection" /> containing the keys in the <see cref="T:System.Collections.Specialized.HybridDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.ICollection" /> containing the keys in the <see cref="T:System.Collections.Specialized.HybridDictionary" />.</returns>
// Token: 0x1700006E RID: 110
// (get) Token: 0x0600019F RID: 415 RVA: 0x00006E0C File Offset: 0x0000500C
public ICollection Keys
{
get
{
return this.inner.Keys;
}
}
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.HybridDictionary" />.</summary>
/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.HybridDictionary" />.</returns>
// Token: 0x1700006F RID: 111
// (get) Token: 0x060001A0 RID: 416 RVA: 0x00006E1C File Offset: 0x0000501C
public object SyncRoot
{
get
{
return this;
}
}
/// <summary>Gets an <see cref="T:System.Collections.ICollection" /> containing the values in the <see cref="T:System.Collections.Specialized.HybridDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.ICollection" /> containing the values in the <see cref="T:System.Collections.Specialized.HybridDictionary" />.</returns>
// Token: 0x17000070 RID: 112
// (get) Token: 0x060001A1 RID: 417 RVA: 0x00006E20 File Offset: 0x00005020
public ICollection Values
{
get
{
return this.inner.Values;
}
}
/// <summary>Adds an entry with the specified key and value into the <see cref="T:System.Collections.Specialized.HybridDictionary" />.</summary>
/// <param name="key">The key of the entry to add. </param>
/// <param name="value">The value of the entry to add. The value can be null. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null. </exception>
/// <exception cref="T:System.ArgumentException">An entry with the same key already exists in the <see cref="T:System.Collections.Specialized.HybridDictionary" />. </exception>
// Token: 0x060001A2 RID: 418 RVA: 0x00006E30 File Offset: 0x00005030
public void Add(object key, object value)
{
this.inner.Add(key, value);
if (this.list != null && this.Count > 10)
{
this.Switch();
}
}
/// <summary>Removes all entries from the <see cref="T:System.Collections.Specialized.HybridDictionary" />.</summary>
// Token: 0x060001A3 RID: 419 RVA: 0x00006E60 File Offset: 0x00005060
public void Clear()
{
this.inner.Clear();
}
/// <summary>Determines whether the <see cref="T:System.Collections.Specialized.HybridDictionary" /> contains a specific key.</summary>
/// <returns>true if the <see cref="T:System.Collections.Specialized.HybridDictionary" /> contains an entry with the specified key; otherwise, false.</returns>
/// <param name="key">The key to locate in the <see cref="T:System.Collections.Specialized.HybridDictionary" />. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null. </exception>
// Token: 0x060001A4 RID: 420 RVA: 0x00006E70 File Offset: 0x00005070
public bool Contains(object key)
{
return this.inner.Contains(key);
}
/// <summary>Copies the <see cref="T:System.Collections.Specialized.HybridDictionary" /> entries to a one-dimensional <see cref="T:System.Array" /> instance at the specified index.</summary>
/// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the <see cref="T:System.Collections.DictionaryEntry" /> objects copied from <see cref="T:System.Collections.Specialized.HybridDictionary" />. The <see cref="T:System.Array" /> must have zero-based indexing. </param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or- The number of elements in the source <see cref="T:System.Collections.Specialized.HybridDictionary" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />. </exception>
/// <exception cref="T:System.InvalidCastException">The type of the source <see cref="T:System.Collections.Specialized.HybridDictionary" /> cannot be cast automatically to the type of the destination <paramref name="array" />. </exception>
// Token: 0x060001A5 RID: 421 RVA: 0x00006E80 File Offset: 0x00005080
public void CopyTo(Array array, int index)
{
this.inner.CopyTo(array, index);
}
/// <summary>Returns an <see cref="T:System.Collections.IDictionaryEnumerator" /> that iterates through the <see cref="T:System.Collections.Specialized.HybridDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.IDictionaryEnumerator" /> for the <see cref="T:System.Collections.Specialized.HybridDictionary" />.</returns>
// Token: 0x060001A6 RID: 422 RVA: 0x00006E90 File Offset: 0x00005090
public IDictionaryEnumerator GetEnumerator()
{
return this.inner.GetEnumerator();
}
/// <summary>Removes the entry with the specified key from the <see cref="T:System.Collections.Specialized.HybridDictionary" />.</summary>
/// <param name="key">The key of the entry to remove. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null. </exception>
// Token: 0x060001A7 RID: 423 RVA: 0x00006EA0 File Offset: 0x000050A0
public void Remove(object key)
{
this.inner.Remove(key);
}
// Token: 0x060001A8 RID: 424 RVA: 0x00006EB0 File Offset: 0x000050B0
private void Switch()
{
IComparer comparer = ((!this.caseInsensitive) ? null : CaseInsensitiveComparer.DefaultInvariant);
IHashCodeProvider hashCodeProvider = ((!this.caseInsensitive) ? null : CaseInsensitiveHashCodeProvider.DefaultInvariant);
this.hashtable = new Hashtable(this.list, hashCodeProvider, comparer);
this.list.Clear();
this.list = null;
}
// Token: 0x04000082 RID: 130
private const int switchAfter = 10;
// Token: 0x04000083 RID: 131
private bool caseInsensitive;
// Token: 0x04000084 RID: 132
private Hashtable hashtable;
// Token: 0x04000085 RID: 133
private ListDictionary list;
}
}
@@ -0,0 +1,43 @@
using System;
namespace System.Collections.Specialized
{
/// <summary>Represents an indexed collection of key/value pairs.</summary>
// Token: 0x02000029 RID: 41
public interface IOrderedDictionary : ICollection, IDictionary, IEnumerable
{
/// <summary>Returns an enumerator that iterates through the <see cref="T:System.Collections.Specialized.IOrderedDictionary" /> collection.</summary>
/// <returns>An <see cref="T:System.Collections.IDictionaryEnumerator" /> for the entire <see cref="T:System.Collections.Specialized.IOrderedDictionary" /> collection.</returns>
// Token: 0x060001A9 RID: 425
IDictionaryEnumerator GetEnumerator();
/// <summary>Inserts a key/value pair into the collection at the specified index.</summary>
/// <param name="index">The zero-based index at which the key/value pair should be inserted.</param>
/// <param name="key">The object to use as the key of the element to add.</param>
/// <param name="value">The object to use as the value of the element to add. The value can be null.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than 0.-or-<paramref name="index" /> is greater than <see cref="P:System.Collections.ICollection.Count" />.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">An element with the same key already exists in the <see cref="T:System.Collections.Specialized.IOrderedDictionary" /> collection.</exception>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Specialized.IOrderedDictionary" /> collection is read-only.-or-The <see cref="T:System.Collections.Specialized.IOrderedDictionary" /> collection has a fixed size.</exception>
// Token: 0x060001AA RID: 426
void Insert(int idx, object key, object value);
/// <summary>Removes the element at the specified index.</summary>
/// <param name="index">The zero-based index of the element to remove.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than 0.-or- <paramref name="index" /> is equal to or greater than <see cref="P:System.Collections.ICollection.Count" />. </exception>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Specialized.IOrderedDictionary" /> collection is read-only.-or- The <see cref="T:System.Collections.Specialized.IOrderedDictionary" /> collection has a fixed size. </exception>
// Token: 0x060001AB RID: 427
void RemoveAt(int idx);
/// <summary>Gets or sets the element at the specified index.</summary>
/// <returns>The element at the specified index.</returns>
/// <param name="index">The zero-based index of the element to get or set.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than 0.-or- <paramref name="index" /> is equal to or greater than <see cref="P:System.Collections.ICollection.Count" />. </exception>
// Token: 0x17000071 RID: 113
object this[int idx] { get; set; }
}
}
@@ -0,0 +1,602 @@
using System;
namespace System.Collections.Specialized
{
/// <summary>Implements IDictionary using a singly linked list. Recommended for collections that typically contain 10 items or less.</summary>
// Token: 0x0200002A RID: 42
[Serializable]
public class ListDictionary : ICollection, IDictionary, IEnumerable
{
/// <summary>Creates an empty <see cref="T:System.Collections.Specialized.ListDictionary" /> using the default comparer.</summary>
// Token: 0x060001AE RID: 430 RVA: 0x00006F10 File Offset: 0x00005110
public ListDictionary()
{
this.count = 0;
this.version = 0;
this.comparer = null;
this.head = null;
}
/// <summary>Creates an empty <see cref="T:System.Collections.Specialized.ListDictionary" /> using the specified comparer.</summary>
/// <param name="comparer">The <see cref="T:System.Collections.IComparer" /> to use to determine whether two keys are equal.-or- null to use the default comparer, which is each key's implementation of <see cref="M:System.Object.Equals(System.Object)" />. </param>
// Token: 0x060001AF RID: 431 RVA: 0x00006F40 File Offset: 0x00005140
public ListDictionary(IComparer comparer)
: this()
{
this.comparer = comparer;
}
/// <summary>Returns an <see cref="T:System.Collections.IEnumerator" /> that iterates through the <see cref="T:System.Collections.Specialized.ListDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:System.Collections.Specialized.ListDictionary" />.</returns>
// Token: 0x060001B0 RID: 432 RVA: 0x00006F50 File Offset: 0x00005150
IEnumerator IEnumerable.GetEnumerator()
{
return new ListDictionary.DictionaryNodeEnumerator(this);
}
// Token: 0x060001B1 RID: 433 RVA: 0x00006F58 File Offset: 0x00005158
private ListDictionary.DictionaryNode FindEntry(object key)
{
if (key == null)
{
throw new ArgumentNullException("key", "Attempted lookup for a null key.");
}
ListDictionary.DictionaryNode dictionaryNode = this.head;
if (this.comparer == null)
{
while (dictionaryNode != null)
{
if (key.Equals(dictionaryNode.key))
{
break;
}
dictionaryNode = dictionaryNode.next;
}
}
else
{
while (dictionaryNode != null)
{
if (this.comparer.Compare(key, dictionaryNode.key) == 0)
{
break;
}
dictionaryNode = dictionaryNode.next;
}
}
return dictionaryNode;
}
// Token: 0x060001B2 RID: 434 RVA: 0x00006FEC File Offset: 0x000051EC
private ListDictionary.DictionaryNode FindEntry(object key, out ListDictionary.DictionaryNode prev)
{
if (key == null)
{
throw new ArgumentNullException("key", "Attempted lookup for a null key.");
}
ListDictionary.DictionaryNode dictionaryNode = this.head;
prev = null;
if (this.comparer == null)
{
while (dictionaryNode != null)
{
if (key.Equals(dictionaryNode.key))
{
break;
}
prev = dictionaryNode;
dictionaryNode = dictionaryNode.next;
}
}
else
{
while (dictionaryNode != null)
{
if (this.comparer.Compare(key, dictionaryNode.key) == 0)
{
break;
}
prev = dictionaryNode;
dictionaryNode = dictionaryNode.next;
}
}
return dictionaryNode;
}
// Token: 0x060001B3 RID: 435 RVA: 0x00007088 File Offset: 0x00005288
private void AddImpl(object key, object value, ListDictionary.DictionaryNode prev)
{
if (prev == null)
{
this.head = new ListDictionary.DictionaryNode(key, value, this.head);
}
else
{
prev.next = new ListDictionary.DictionaryNode(key, value, prev.next);
}
this.count++;
this.version++;
}
/// <summary>Gets the number of key/value pairs contained in the <see cref="T:System.Collections.Specialized.ListDictionary" />.</summary>
/// <returns>The number of key/value pairs contained in the <see cref="T:System.Collections.Specialized.ListDictionary" />.</returns>
// Token: 0x17000072 RID: 114
// (get) Token: 0x060001B4 RID: 436 RVA: 0x000070E4 File Offset: 0x000052E4
public int Count
{
get
{
return this.count;
}
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.Specialized.ListDictionary" /> is synchronized (thread safe).</summary>
/// <returns>This property always returns false.</returns>
// Token: 0x17000073 RID: 115
// (get) Token: 0x060001B5 RID: 437 RVA: 0x000070EC File Offset: 0x000052EC
public bool IsSynchronized
{
get
{
return false;
}
}
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.ListDictionary" />.</summary>
/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.ListDictionary" />.</returns>
// Token: 0x17000074 RID: 116
// (get) Token: 0x060001B6 RID: 438 RVA: 0x000070F0 File Offset: 0x000052F0
public object SyncRoot
{
get
{
return this;
}
}
/// <summary>Copies the <see cref="T:System.Collections.Specialized.ListDictionary" /> entries to a one-dimensional <see cref="T:System.Array" /> instance at the specified index.</summary>
/// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the <see cref="T:System.Collections.DictionaryEntry" /> objects copied from <see cref="T:System.Collections.Specialized.ListDictionary" />. The <see cref="T:System.Array" /> must have zero-based indexing. </param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or- The number of elements in the source <see cref="T:System.Collections.Specialized.ListDictionary" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />. </exception>
/// <exception cref="T:System.InvalidCastException">The type of the source <see cref="T:System.Collections.Specialized.ListDictionary" /> cannot be cast automatically to the type of the destination <paramref name="array" />. </exception>
// Token: 0x060001B7 RID: 439 RVA: 0x000070F4 File Offset: 0x000052F4
public void CopyTo(Array array, int index)
{
if (array == null)
{
throw new ArgumentNullException("array", "Array cannot be null.");
}
if (index < 0)
{
throw new ArgumentOutOfRangeException("index", "index is less than 0");
}
if (index > array.Length)
{
throw new IndexOutOfRangeException("index is too large");
}
if (this.Count > array.Length - index)
{
throw new ArgumentException("Not enough room in the array");
}
foreach (object obj in this)
{
DictionaryEntry dictionaryEntry = (DictionaryEntry)obj;
array.SetValue(dictionaryEntry, index++);
}
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.Specialized.ListDictionary" /> has a fixed size.</summary>
/// <returns>This property always returns false.</returns>
// Token: 0x17000075 RID: 117
// (get) Token: 0x060001B8 RID: 440 RVA: 0x000071CC File Offset: 0x000053CC
public bool IsFixedSize
{
get
{
return false;
}
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.Specialized.ListDictionary" /> is read-only.</summary>
/// <returns>This property always returns false.</returns>
// Token: 0x17000076 RID: 118
// (get) Token: 0x060001B9 RID: 441 RVA: 0x000071D0 File Offset: 0x000053D0
public bool IsReadOnly
{
get
{
return false;
}
}
/// <summary>Gets or sets the value associated with the specified key.</summary>
/// <returns>The value associated with the specified key. If the specified key is not found, attempting to get it returns null, and attempting to set it creates a new entry using the specified key.</returns>
/// <param name="key">The key whose value to get or set. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null. </exception>
// Token: 0x17000077 RID: 119
public object this[object key]
{
get
{
ListDictionary.DictionaryNode dictionaryNode = this.FindEntry(key);
return (dictionaryNode != null) ? dictionaryNode.value : null;
}
set
{
ListDictionary.DictionaryNode dictionaryNode2;
ListDictionary.DictionaryNode dictionaryNode = this.FindEntry(key, out dictionaryNode2);
if (dictionaryNode != null)
{
dictionaryNode.value = value;
}
else
{
this.AddImpl(key, value, dictionaryNode2);
}
}
}
/// <summary>Gets an <see cref="T:System.Collections.ICollection" /> containing the keys in the <see cref="T:System.Collections.Specialized.ListDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.ICollection" /> containing the keys in the <see cref="T:System.Collections.Specialized.ListDictionary" />.</returns>
// Token: 0x17000078 RID: 120
// (get) Token: 0x060001BC RID: 444 RVA: 0x00007230 File Offset: 0x00005430
public ICollection Keys
{
get
{
return new ListDictionary.DictionaryNodeCollection(this, true);
}
}
/// <summary>Gets an <see cref="T:System.Collections.ICollection" /> containing the values in the <see cref="T:System.Collections.Specialized.ListDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.ICollection" /> containing the values in the <see cref="T:System.Collections.Specialized.ListDictionary" />.</returns>
// Token: 0x17000079 RID: 121
// (get) Token: 0x060001BD RID: 445 RVA: 0x0000723C File Offset: 0x0000543C
public ICollection Values
{
get
{
return new ListDictionary.DictionaryNodeCollection(this, false);
}
}
/// <summary>Adds an entry with the specified key and value into the <see cref="T:System.Collections.Specialized.ListDictionary" />.</summary>
/// <param name="key">The key of the entry to add. </param>
/// <param name="value">The value of the entry to add. The value can be null. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null. </exception>
/// <exception cref="T:System.ArgumentException">An entry with the same key already exists in the <see cref="T:System.Collections.Specialized.ListDictionary" />. </exception>
// Token: 0x060001BE RID: 446 RVA: 0x00007248 File Offset: 0x00005448
public void Add(object key, object value)
{
ListDictionary.DictionaryNode dictionaryNode2;
ListDictionary.DictionaryNode dictionaryNode = this.FindEntry(key, out dictionaryNode2);
if (dictionaryNode != null)
{
throw new ArgumentException("key", "Duplicate key in add.");
}
this.AddImpl(key, value, dictionaryNode2);
}
/// <summary>Removes all entries from the <see cref="T:System.Collections.Specialized.ListDictionary" />.</summary>
// Token: 0x060001BF RID: 447 RVA: 0x00007280 File Offset: 0x00005480
public void Clear()
{
this.head = null;
this.count = 0;
this.version++;
}
/// <summary>Determines whether the <see cref="T:System.Collections.Specialized.ListDictionary" /> contains a specific key.</summary>
/// <returns>true if the <see cref="T:System.Collections.Specialized.ListDictionary" /> contains an entry with the specified key; otherwise, false.</returns>
/// <param name="key">The key to locate in the <see cref="T:System.Collections.Specialized.ListDictionary" />. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null. </exception>
// Token: 0x060001C0 RID: 448 RVA: 0x000072A0 File Offset: 0x000054A0
public bool Contains(object key)
{
return this.FindEntry(key) != null;
}
/// <summary>Returns an <see cref="T:System.Collections.IDictionaryEnumerator" /> that iterates through the <see cref="T:System.Collections.Specialized.ListDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.IDictionaryEnumerator" /> for the <see cref="T:System.Collections.Specialized.ListDictionary" />.</returns>
// Token: 0x060001C1 RID: 449 RVA: 0x000072B0 File Offset: 0x000054B0
public IDictionaryEnumerator GetEnumerator()
{
return new ListDictionary.DictionaryNodeEnumerator(this);
}
/// <summary>Removes the entry with the specified key from the <see cref="T:System.Collections.Specialized.ListDictionary" />.</summary>
/// <param name="key">The key of the entry to remove. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null. </exception>
// Token: 0x060001C2 RID: 450 RVA: 0x000072B8 File Offset: 0x000054B8
public void Remove(object key)
{
ListDictionary.DictionaryNode dictionaryNode2;
ListDictionary.DictionaryNode dictionaryNode = this.FindEntry(key, out dictionaryNode2);
if (dictionaryNode == null)
{
return;
}
if (dictionaryNode2 == null)
{
this.head = dictionaryNode.next;
}
else
{
dictionaryNode2.next = dictionaryNode.next;
}
dictionaryNode.value = null;
this.count--;
this.version++;
}
// Token: 0x04000086 RID: 134
private int count;
// Token: 0x04000087 RID: 135
private int version;
// Token: 0x04000088 RID: 136
private ListDictionary.DictionaryNode head;
// Token: 0x04000089 RID: 137
private IComparer comparer;
// Token: 0x0200002B RID: 43
[Serializable]
private class DictionaryNode
{
// Token: 0x060001C3 RID: 451 RVA: 0x0000731C File Offset: 0x0000551C
public DictionaryNode(object key, object value, ListDictionary.DictionaryNode next)
{
this.key = key;
this.value = value;
this.next = next;
}
// Token: 0x0400008A RID: 138
public object key;
// Token: 0x0400008B RID: 139
public object value;
// Token: 0x0400008C RID: 140
public ListDictionary.DictionaryNode next;
}
// Token: 0x0200002C RID: 44
private class DictionaryNodeEnumerator : IEnumerator, IDictionaryEnumerator
{
// Token: 0x060001C4 RID: 452 RVA: 0x0000733C File Offset: 0x0000553C
public DictionaryNodeEnumerator(ListDictionary dict)
{
this.dict = dict;
this.version = dict.version;
this.Reset();
}
// Token: 0x060001C5 RID: 453 RVA: 0x00007360 File Offset: 0x00005560
private void FailFast()
{
if (this.version != this.dict.version)
{
throw new InvalidOperationException("The ListDictionary's contents changed after this enumerator was instantiated.");
}
}
// Token: 0x060001C6 RID: 454 RVA: 0x00007384 File Offset: 0x00005584
public bool MoveNext()
{
this.FailFast();
if (this.current == null && !this.isAtStart)
{
return false;
}
this.current = ((!this.isAtStart) ? this.current.next : this.dict.head);
this.isAtStart = false;
return this.current != null;
}
// Token: 0x060001C7 RID: 455 RVA: 0x000073F0 File Offset: 0x000055F0
public void Reset()
{
this.FailFast();
this.isAtStart = true;
this.current = null;
}
// Token: 0x1700007A RID: 122
// (get) Token: 0x060001C8 RID: 456 RVA: 0x00007408 File Offset: 0x00005608
public object Current
{
get
{
return this.Entry;
}
}
// Token: 0x1700007B RID: 123
// (get) Token: 0x060001C9 RID: 457 RVA: 0x00007418 File Offset: 0x00005618
private ListDictionary.DictionaryNode DictionaryNode
{
get
{
this.FailFast();
if (this.current == null)
{
throw new InvalidOperationException("Enumerator is positioned before the collection's first element or after the last element.");
}
return this.current;
}
}
// Token: 0x1700007C RID: 124
// (get) Token: 0x060001CA RID: 458 RVA: 0x00007448 File Offset: 0x00005648
public DictionaryEntry Entry
{
get
{
object key = this.DictionaryNode.key;
return new DictionaryEntry(key, this.current.value);
}
}
// Token: 0x1700007D RID: 125
// (get) Token: 0x060001CB RID: 459 RVA: 0x00007474 File Offset: 0x00005674
public object Key
{
get
{
return this.DictionaryNode.key;
}
}
// Token: 0x1700007E RID: 126
// (get) Token: 0x060001CC RID: 460 RVA: 0x00007484 File Offset: 0x00005684
public object Value
{
get
{
return this.DictionaryNode.value;
}
}
// Token: 0x0400008D RID: 141
private ListDictionary dict;
// Token: 0x0400008E RID: 142
private bool isAtStart;
// Token: 0x0400008F RID: 143
private ListDictionary.DictionaryNode current;
// Token: 0x04000090 RID: 144
private int version;
}
// Token: 0x0200002D RID: 45
private class DictionaryNodeCollection : ICollection, IEnumerable
{
// Token: 0x060001CD RID: 461 RVA: 0x00007494 File Offset: 0x00005694
public DictionaryNodeCollection(ListDictionary dict, bool isKeyList)
{
this.dict = dict;
this.isKeyList = isKeyList;
}
// Token: 0x1700007F RID: 127
// (get) Token: 0x060001CE RID: 462 RVA: 0x000074AC File Offset: 0x000056AC
public int Count
{
get
{
return this.dict.Count;
}
}
// Token: 0x17000080 RID: 128
// (get) Token: 0x060001CF RID: 463 RVA: 0x000074BC File Offset: 0x000056BC
public bool IsSynchronized
{
get
{
return false;
}
}
// Token: 0x17000081 RID: 129
// (get) Token: 0x060001D0 RID: 464 RVA: 0x000074C0 File Offset: 0x000056C0
public object SyncRoot
{
get
{
return this.dict.SyncRoot;
}
}
// Token: 0x060001D1 RID: 465 RVA: 0x000074D0 File Offset: 0x000056D0
public void CopyTo(Array array, int index)
{
if (array == null)
{
throw new ArgumentNullException("array", "Array cannot be null.");
}
if (index < 0)
{
throw new ArgumentOutOfRangeException("index", "index is less than 0");
}
if (index > array.Length)
{
throw new IndexOutOfRangeException("index is too large");
}
if (this.Count > array.Length - index)
{
throw new ArgumentException("Not enough room in the array");
}
foreach (object obj in this)
{
array.SetValue(obj, index++);
}
}
// Token: 0x060001D2 RID: 466 RVA: 0x000075A0 File Offset: 0x000057A0
public IEnumerator GetEnumerator()
{
return new ListDictionary.DictionaryNodeCollection.DictionaryNodeCollectionEnumerator(this.dict.GetEnumerator(), this.isKeyList);
}
// Token: 0x04000091 RID: 145
private ListDictionary dict;
// Token: 0x04000092 RID: 146
private bool isKeyList;
// Token: 0x0200002E RID: 46
private class DictionaryNodeCollectionEnumerator : IEnumerator
{
// Token: 0x060001D3 RID: 467 RVA: 0x000075B8 File Offset: 0x000057B8
public DictionaryNodeCollectionEnumerator(IDictionaryEnumerator inner, bool isKeyList)
{
this.inner = inner;
this.isKeyList = isKeyList;
}
// Token: 0x17000082 RID: 130
// (get) Token: 0x060001D4 RID: 468 RVA: 0x000075D0 File Offset: 0x000057D0
public object Current
{
get
{
return (!this.isKeyList) ? this.inner.Value : this.inner.Key;
}
}
// Token: 0x060001D5 RID: 469 RVA: 0x00007604 File Offset: 0x00005804
public bool MoveNext()
{
return this.inner.MoveNext();
}
// Token: 0x060001D6 RID: 470 RVA: 0x00007614 File Offset: 0x00005814
public void Reset()
{
this.inner.Reset();
}
// Token: 0x04000093 RID: 147
private IDictionaryEnumerator inner;
// Token: 0x04000094 RID: 148
private bool isKeyList;
}
}
}
}
@@ -0,0 +1,822 @@
using System;
using System.Runtime.Serialization;
namespace System.Collections.Specialized
{
/// <summary>Provides the abstract base class for a collection of associated <see cref="T:System.String" /> keys and <see cref="T:System.Object" /> values that can be accessed either with the key or with the index.</summary>
// Token: 0x0200002F RID: 47
[Serializable]
public abstract class NameObjectCollectionBase : ICollection, IDeserializationCallback, IEnumerable, ISerializable
{
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> class that is empty.</summary>
// Token: 0x060001D7 RID: 471 RVA: 0x00007624 File Offset: 0x00005824
protected NameObjectCollectionBase()
{
this.m_readonly = false;
this.m_hashprovider = CaseInsensitiveHashCodeProvider.DefaultInvariant;
this.m_comparer = CaseInsensitiveComparer.DefaultInvariant;
this.m_defCapacity = 0;
this.Init();
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> class that is empty, has the specified initial capacity, and uses the default hash code provider and the default comparer.</summary>
/// <param name="capacity">The approximate number of entries that the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance can initially contain.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="capacity" /> is less than zero. </exception>
// Token: 0x060001D8 RID: 472 RVA: 0x00007664 File Offset: 0x00005864
protected NameObjectCollectionBase(int capacity)
{
this.m_readonly = false;
this.m_hashprovider = CaseInsensitiveHashCodeProvider.DefaultInvariant;
this.m_comparer = CaseInsensitiveComparer.DefaultInvariant;
this.m_defCapacity = capacity;
this.Init();
}
// Token: 0x060001D9 RID: 473 RVA: 0x000076A4 File Offset: 0x000058A4
internal NameObjectCollectionBase(IEqualityComparer equalityComparer, IComparer comparer, IHashCodeProvider hcp)
{
this.equality_comparer = equalityComparer;
this.m_comparer = comparer;
this.m_hashprovider = hcp;
this.m_readonly = false;
this.m_defCapacity = 0;
this.Init();
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> class that is empty, has the default initial capacity, and uses the specified <see cref="T:System.Collections.IEqualityComparer" /> object.</summary>
/// <param name="equalityComparer">The <see cref="T:System.Collections.IEqualityComparer" /> object to use to determine whether two keys are equal and to generate hash codes for the keys in the collection.</param>
// Token: 0x060001DA RID: 474 RVA: 0x000076D8 File Offset: 0x000058D8
protected NameObjectCollectionBase(IEqualityComparer equalityComparer)
{
IEqualityComparer equalityComparer2;
if (equalityComparer == null)
{
IEqualityComparer invariantCultureIgnoreCase = StringComparer.InvariantCultureIgnoreCase;
equalityComparer2 = invariantCultureIgnoreCase;
}
else
{
equalityComparer2 = equalityComparer;
}
this..ctor(equalityComparer2, null, null);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> class that is empty, has the default initial capacity, and uses the specified hash code provider and the specified comparer.</summary>
/// <param name="hashProvider">The <see cref="T:System.Collections.IHashCodeProvider" /> that will supply the hash codes for all keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</param>
/// <param name="comparer">The <see cref="T:System.Collections.IComparer" /> to use to determine whether two keys are equal.</param>
// Token: 0x060001DB RID: 475 RVA: 0x00007700 File Offset: 0x00005900
[Obsolete("Use NameObjectCollectionBase(IEqualityComparer)")]
protected NameObjectCollectionBase(IHashCodeProvider hashProvider, IComparer comparer)
{
this.m_comparer = comparer;
this.m_hashprovider = hashProvider;
this.m_readonly = false;
this.m_defCapacity = 0;
this.Init();
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> class that is serializable and uses the specified <see cref="T:System.Runtime.Serialization.SerializationInfo" /> and <see cref="T:System.Runtime.Serialization.StreamingContext" />.</summary>
/// <param name="info">A <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object that contains the information required to serialize the new <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</param>
/// <param name="context">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> object that contains the source and destination of the serialized stream associated with the new <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</param>
// Token: 0x060001DC RID: 476 RVA: 0x00007738 File Offset: 0x00005938
protected NameObjectCollectionBase(SerializationInfo info, StreamingContext context)
{
this.infoCopy = info;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> class that is empty, has the specified initial capacity, and uses the specified <see cref="T:System.Collections.IEqualityComparer" /> object.</summary>
/// <param name="capacity">The approximate number of entries that the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> object can initially contain.</param>
/// <param name="equalityComparer">The <see cref="T:System.Collections.IEqualityComparer" /> object to use to determine whether two keys are equal and to generate hash codes for the keys in the collection.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="capacity" /> is less than zero.</exception>
// Token: 0x060001DD RID: 477 RVA: 0x00007748 File Offset: 0x00005948
protected NameObjectCollectionBase(int capacity, IEqualityComparer equalityComparer)
{
this.m_readonly = false;
IEqualityComparer equalityComparer2;
if (equalityComparer == null)
{
IEqualityComparer invariantCultureIgnoreCase = StringComparer.InvariantCultureIgnoreCase;
equalityComparer2 = invariantCultureIgnoreCase;
}
else
{
equalityComparer2 = equalityComparer;
}
this.equality_comparer = equalityComparer2;
this.m_defCapacity = capacity;
this.Init();
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> class that is empty, has the specified initial capacity and uses the specified hash code provider and the specified comparer.</summary>
/// <param name="capacity">The approximate number of entries that the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance can initially contain.</param>
/// <param name="hashProvider">The <see cref="T:System.Collections.IHashCodeProvider" /> that will supply the hash codes for all keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</param>
/// <param name="comparer">The <see cref="T:System.Collections.IComparer" /> to use to determine whether two keys are equal.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="capacity" /> is less than zero.</exception>
// Token: 0x060001DE RID: 478 RVA: 0x00007788 File Offset: 0x00005988
[Obsolete("Use NameObjectCollectionBase(int,IEqualityComparer)")]
protected NameObjectCollectionBase(int capacity, IHashCodeProvider hashProvider, IComparer comparer)
{
this.m_readonly = false;
this.m_hashprovider = hashProvider;
this.m_comparer = comparer;
this.m_defCapacity = capacity;
this.Init();
}
/// <summary>Gets a value indicating whether access to the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> object is synchronized (thread safe).</summary>
/// <returns>true if access to the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> object is synchronized (thread safe); otherwise, false. The default is false.</returns>
// Token: 0x17000083 RID: 131
// (get) Token: 0x060001DF RID: 479 RVA: 0x000077C0 File Offset: 0x000059C0
bool ICollection.IsSynchronized
{
get
{
return false;
}
}
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> object.</summary>
/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> object.</returns>
// Token: 0x17000084 RID: 132
// (get) Token: 0x060001E0 RID: 480 RVA: 0x000077C4 File Offset: 0x000059C4
object ICollection.SyncRoot
{
get
{
return this;
}
}
/// <summary>Copies the entire <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> to a compatible one-dimensional <see cref="T:System.Array" />, starting at the specified index of the target array.</summary>
/// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" />. The <see cref="T:System.Array" /> must have zero-based indexing.</param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or-The number of elements in the source <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.</exception>
/// <exception cref="T:System.InvalidCastException">The type of the source <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> cannot be cast automatically to the type of the destination <paramref name="array" />.</exception>
// Token: 0x060001E1 RID: 481 RVA: 0x000077C8 File Offset: 0x000059C8
void ICollection.CopyTo(Array array, int index)
{
((ICollection)this.Keys).CopyTo(array, index);
}
// Token: 0x17000085 RID: 133
// (get) Token: 0x060001E2 RID: 482 RVA: 0x000077D8 File Offset: 0x000059D8
internal IEqualityComparer EqualityComparer
{
get
{
return this.equality_comparer;
}
}
// Token: 0x17000086 RID: 134
// (get) Token: 0x060001E3 RID: 483 RVA: 0x000077E0 File Offset: 0x000059E0
internal IComparer Comparer
{
get
{
return this.m_comparer;
}
}
// Token: 0x17000087 RID: 135
// (get) Token: 0x060001E4 RID: 484 RVA: 0x000077E8 File Offset: 0x000059E8
internal IHashCodeProvider HashCodeProvider
{
get
{
return this.m_hashprovider;
}
}
// Token: 0x060001E5 RID: 485 RVA: 0x000077F0 File Offset: 0x000059F0
private void Init()
{
if (this.equality_comparer != null)
{
this.m_ItemsContainer = new Hashtable(this.m_defCapacity, this.equality_comparer);
}
else
{
this.m_ItemsContainer = new Hashtable(this.m_defCapacity, this.m_hashprovider, this.m_comparer);
}
this.m_ItemsArray = new ArrayList();
this.m_NullKeyItem = null;
}
/// <summary>Gets a <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" /> instance that contains all the keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
/// <returns>A <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" /> instance that contains all the keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</returns>
// Token: 0x17000088 RID: 136
// (get) Token: 0x060001E6 RID: 486 RVA: 0x00007854 File Offset: 0x00005A54
public virtual NameObjectCollectionBase.KeysCollection Keys
{
get
{
if (this.keyscoll == null)
{
this.keyscoll = new NameObjectCollectionBase.KeysCollection(this);
}
return this.keyscoll;
}
}
/// <summary>Returns an enumerator that iterates through the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" />.</summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</returns>
// Token: 0x060001E7 RID: 487 RVA: 0x00007874 File Offset: 0x00005A74
public virtual IEnumerator GetEnumerator()
{
return new NameObjectCollectionBase._KeysEnumerator(this);
}
/// <summary>Implements the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface and returns the data needed to serialize the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
/// <param name="info">A <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object that contains the information required to serialize the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</param>
/// <param name="context">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> object that contains the source and destination of the serialized stream associated with the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="info" /> is null.</exception>
// Token: 0x060001E8 RID: 488 RVA: 0x0000787C File Offset: 0x00005A7C
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
int count = this.Count;
string[] array = new string[count];
object[] array2 = new object[count];
int num = 0;
foreach (object obj in this.m_ItemsArray)
{
NameObjectCollectionBase._Item item = (NameObjectCollectionBase._Item)obj;
array[num] = item.key;
array2[num] = item.value;
num++;
}
if (this.equality_comparer != null)
{
info.AddValue("KeyComparer", this.equality_comparer, typeof(IEqualityComparer));
info.AddValue("Version", 4, typeof(int));
}
else
{
info.AddValue("HashProvider", this.m_hashprovider, typeof(IHashCodeProvider));
info.AddValue("Comparer", this.m_comparer, typeof(IComparer));
info.AddValue("Version", 2, typeof(int));
}
info.AddValue("ReadOnly", this.m_readonly);
info.AddValue("Count", count);
info.AddValue("Keys", array, typeof(string[]));
info.AddValue("Values", array2, typeof(object[]));
}
/// <summary>Gets the number of key/value pairs contained in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
/// <returns>The number of key/value pairs contained in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</returns>
// Token: 0x17000089 RID: 137
// (get) Token: 0x060001E9 RID: 489 RVA: 0x00007A0C File Offset: 0x00005C0C
public virtual int Count
{
get
{
return this.m_ItemsArray.Count;
}
}
/// <summary>Implements the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface and raises the deserialization event when the deserialization is complete.</summary>
/// <param name="sender">The source of the deserialization event.</param>
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object associated with the current <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance is invalid.</exception>
// Token: 0x060001EA RID: 490 RVA: 0x00007A1C File Offset: 0x00005C1C
public virtual void OnDeserialization(object sender)
{
SerializationInfo serializationInfo = this.infoCopy;
if (serializationInfo == null)
{
return;
}
this.infoCopy = null;
this.m_hashprovider = (IHashCodeProvider)serializationInfo.GetValue("HashProvider", typeof(IHashCodeProvider));
if (this.m_hashprovider == null)
{
this.equality_comparer = (IEqualityComparer)serializationInfo.GetValue("KeyComparer", typeof(IEqualityComparer));
}
else
{
this.m_comparer = (IComparer)serializationInfo.GetValue("Comparer", typeof(IComparer));
if (this.m_comparer == null)
{
throw new SerializationException("The comparer is null");
}
}
this.m_readonly = serializationInfo.GetBoolean("ReadOnly");
string[] array = (string[])serializationInfo.GetValue("Keys", typeof(string[]));
if (array == null)
{
throw new SerializationException("keys is null");
}
object[] array2 = (object[])serializationInfo.GetValue("Values", typeof(object[]));
if (array2 == null)
{
throw new SerializationException("values is null");
}
this.Init();
int num = array.Length;
for (int i = 0; i < num; i++)
{
this.BaseAdd(array[i], array2[i]);
}
}
/// <summary>Gets or sets a value indicating whether the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance is read-only.</summary>
/// <returns>true if the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance is read-only; otherwise, false.</returns>
// Token: 0x1700008A RID: 138
// (get) Token: 0x060001EB RID: 491 RVA: 0x00007B5C File Offset: 0x00005D5C
// (set) Token: 0x060001EC RID: 492 RVA: 0x00007B64 File Offset: 0x00005D64
protected bool IsReadOnly
{
get
{
return this.m_readonly;
}
set
{
this.m_readonly = value;
}
}
/// <summary>Adds an entry with the specified key and value into the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
/// <param name="name">The <see cref="T:System.String" /> key of the entry to add. The key can be null.</param>
/// <param name="value">The <see cref="T:System.Object" /> value of the entry to add. The value can be null.</param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only. </exception>
// Token: 0x060001ED RID: 493 RVA: 0x00007B70 File Offset: 0x00005D70
protected void BaseAdd(string name, object value)
{
if (this.IsReadOnly)
{
throw new NotSupportedException("Collection is read-only");
}
NameObjectCollectionBase._Item item = new NameObjectCollectionBase._Item(name, value);
if (name == null)
{
if (this.m_NullKeyItem == null)
{
this.m_NullKeyItem = item;
}
}
else if (this.m_ItemsContainer[name] == null)
{
this.m_ItemsContainer.Add(name, item);
}
this.m_ItemsArray.Add(item);
}
/// <summary>Removes all entries from the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
// Token: 0x060001EE RID: 494 RVA: 0x00007BE4 File Offset: 0x00005DE4
protected void BaseClear()
{
if (this.IsReadOnly)
{
throw new NotSupportedException("Collection is read-only");
}
this.Init();
}
/// <summary>Gets the value of the entry at the specified index of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
/// <returns>An <see cref="T:System.Object" /> that represents the value of the entry at the specified index.</returns>
/// <param name="index">The zero-based index of the value to get.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is outside the valid range of indexes for the collection. </exception>
// Token: 0x060001EF RID: 495 RVA: 0x00007C04 File Offset: 0x00005E04
protected object BaseGet(int index)
{
return ((NameObjectCollectionBase._Item)this.m_ItemsArray[index]).value;
}
/// <summary>Gets the value of the first entry with the specified key from the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
/// <returns>An <see cref="T:System.Object" /> that represents the value of the first entry with the specified key, if found; otherwise, null.</returns>
/// <param name="name">The <see cref="T:System.String" /> key of the entry to get. The key can be null.</param>
// Token: 0x060001F0 RID: 496 RVA: 0x00007C1C File Offset: 0x00005E1C
protected object BaseGet(string name)
{
NameObjectCollectionBase._Item item = this.FindFirstMatchedItem(name);
if (item == null)
{
return null;
}
return item.value;
}
/// <summary>Returns a <see cref="T:System.String" /> array that contains all the keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
/// <returns>A <see cref="T:System.String" /> array that contains all the keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</returns>
// Token: 0x060001F1 RID: 497 RVA: 0x00007C40 File Offset: 0x00005E40
protected string[] BaseGetAllKeys()
{
int count = this.m_ItemsArray.Count;
string[] array = new string[count];
for (int i = 0; i < count; i++)
{
array[i] = this.BaseGetKey(i);
}
return array;
}
/// <summary>Returns an <see cref="T:System.Object" /> array that contains all the values in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
/// <returns>An <see cref="T:System.Object" /> array that contains all the values in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</returns>
// Token: 0x060001F2 RID: 498 RVA: 0x00007C80 File Offset: 0x00005E80
protected object[] BaseGetAllValues()
{
int count = this.m_ItemsArray.Count;
object[] array = new object[count];
for (int i = 0; i < count; i++)
{
array[i] = this.BaseGet(i);
}
return array;
}
/// <summary>Returns an array of the specified type that contains all the values in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
/// <returns>An array of the specified type that contains all the values in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</returns>
/// <param name="type">A <see cref="T:System.Type" /> that represents the type of array to return.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="type" /> is null. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="type" /> is not a valid <see cref="T:System.Type" />. </exception>
// Token: 0x060001F3 RID: 499 RVA: 0x00007CC0 File Offset: 0x00005EC0
protected object[] BaseGetAllValues(Type type)
{
if (type == null)
{
throw new ArgumentNullException("'type' argument can't be null");
}
int count = this.m_ItemsArray.Count;
object[] array = (object[])Array.CreateInstance(type, count);
for (int i = 0; i < count; i++)
{
array[i] = this.BaseGet(i);
}
return array;
}
/// <summary>Gets the key of the entry at the specified index of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
/// <returns>A <see cref="T:System.String" /> that represents the key of the entry at the specified index.</returns>
/// <param name="index">The zero-based index of the key to get.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is outside the valid range of indexes for the collection. </exception>
// Token: 0x060001F4 RID: 500 RVA: 0x00007D14 File Offset: 0x00005F14
protected string BaseGetKey(int index)
{
return ((NameObjectCollectionBase._Item)this.m_ItemsArray[index]).key;
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance contains entries whose keys are not null.</summary>
/// <returns>true if the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance contains entries whose keys are not null; otherwise, false.</returns>
// Token: 0x060001F5 RID: 501 RVA: 0x00007D2C File Offset: 0x00005F2C
protected bool BaseHasKeys()
{
return this.m_ItemsContainer.Count > 0;
}
/// <summary>Removes the entries with the specified key from the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
/// <param name="name">The <see cref="T:System.String" /> key of the entries to remove. The key can be null.</param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only. </exception>
// Token: 0x060001F6 RID: 502 RVA: 0x00007D3C File Offset: 0x00005F3C
protected void BaseRemove(string name)
{
if (this.IsReadOnly)
{
throw new NotSupportedException("Collection is read-only");
}
if (name != null)
{
this.m_ItemsContainer.Remove(name);
}
else
{
this.m_NullKeyItem = null;
}
int num = this.m_ItemsArray.Count;
int i = 0;
while (i < num)
{
string text = this.BaseGetKey(i);
if (this.Equals(text, name))
{
this.m_ItemsArray.RemoveAt(i);
num--;
}
else
{
i++;
}
}
}
/// <summary>Removes the entry at the specified index of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
/// <param name="index">The zero-based index of the entry to remove.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is outside the valid range of indexes for the collection.</exception>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
// Token: 0x060001F7 RID: 503 RVA: 0x00007DC8 File Offset: 0x00005FC8
protected void BaseRemoveAt(int index)
{
if (this.IsReadOnly)
{
throw new NotSupportedException("Collection is read-only");
}
string text = this.BaseGetKey(index);
if (text != null)
{
this.m_ItemsContainer.Remove(text);
}
else
{
this.m_NullKeyItem = null;
}
this.m_ItemsArray.RemoveAt(index);
}
/// <summary>Sets the value of the entry at the specified index of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
/// <param name="index">The zero-based index of the entry to set.</param>
/// <param name="value">The <see cref="T:System.Object" /> that represents the new value of the entry to set. The value can be null.</param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is outside the valid range of indexes for the collection.</exception>
// Token: 0x060001F8 RID: 504 RVA: 0x00007E20 File Offset: 0x00006020
protected void BaseSet(int index, object value)
{
if (this.IsReadOnly)
{
throw new NotSupportedException("Collection is read-only");
}
NameObjectCollectionBase._Item item = (NameObjectCollectionBase._Item)this.m_ItemsArray[index];
item.value = value;
}
/// <summary>Sets the value of the first entry with the specified key in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance, if found; otherwise, adds an entry with the specified key and value into the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
/// <param name="name">The <see cref="T:System.String" /> key of the entry to set. The key can be null.</param>
/// <param name="value">The <see cref="T:System.Object" /> that represents the new value of the entry to set. The value can be null.</param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only. </exception>
// Token: 0x060001F9 RID: 505 RVA: 0x00007E5C File Offset: 0x0000605C
protected void BaseSet(string name, object value)
{
if (this.IsReadOnly)
{
throw new NotSupportedException("Collection is read-only");
}
NameObjectCollectionBase._Item item = this.FindFirstMatchedItem(name);
if (item != null)
{
item.value = value;
}
else
{
this.BaseAdd(name, value);
}
}
// Token: 0x060001FA RID: 506 RVA: 0x00007EA4 File Offset: 0x000060A4
[global::System.MonoTODO]
private NameObjectCollectionBase._Item FindFirstMatchedItem(string name)
{
if (name != null)
{
return (NameObjectCollectionBase._Item)this.m_ItemsContainer[name];
}
return this.m_NullKeyItem;
}
// Token: 0x060001FB RID: 507 RVA: 0x00007EC4 File Offset: 0x000060C4
internal bool Equals(string s1, string s2)
{
if (this.m_comparer != null)
{
return this.m_comparer.Compare(s1, s2) == 0;
}
return this.equality_comparer.Equals(s1, s2);
}
// Token: 0x04000095 RID: 149
private Hashtable m_ItemsContainer;
// Token: 0x04000096 RID: 150
private NameObjectCollectionBase._Item m_NullKeyItem;
// Token: 0x04000097 RID: 151
private ArrayList m_ItemsArray;
// Token: 0x04000098 RID: 152
private IHashCodeProvider m_hashprovider;
// Token: 0x04000099 RID: 153
private IComparer m_comparer;
// Token: 0x0400009A RID: 154
private int m_defCapacity;
// Token: 0x0400009B RID: 155
private bool m_readonly;
// Token: 0x0400009C RID: 156
private SerializationInfo infoCopy;
// Token: 0x0400009D RID: 157
private NameObjectCollectionBase.KeysCollection keyscoll;
// Token: 0x0400009E RID: 158
private IEqualityComparer equality_comparer;
// Token: 0x02000030 RID: 48
internal class _Item
{
// Token: 0x060001FC RID: 508 RVA: 0x00007EF0 File Offset: 0x000060F0
public _Item(string key, object value)
{
this.key = key;
this.value = value;
}
// Token: 0x0400009F RID: 159
public string key;
// Token: 0x040000A0 RID: 160
public object value;
}
// Token: 0x02000031 RID: 49
[Serializable]
internal class _KeysEnumerator : IEnumerator
{
// Token: 0x060001FD RID: 509 RVA: 0x00007F08 File Offset: 0x00006108
internal _KeysEnumerator(NameObjectCollectionBase collection)
{
this.m_collection = collection;
this.Reset();
}
// Token: 0x1700008B RID: 139
// (get) Token: 0x060001FE RID: 510 RVA: 0x00007F20 File Offset: 0x00006120
public object Current
{
get
{
if (this.m_position < this.m_collection.Count || this.m_position < 0)
{
return this.m_collection.BaseGetKey(this.m_position);
}
throw new InvalidOperationException();
}
}
// Token: 0x060001FF RID: 511 RVA: 0x00007F5C File Offset: 0x0000615C
public bool MoveNext()
{
return ++this.m_position < this.m_collection.Count;
}
// Token: 0x06000200 RID: 512 RVA: 0x00007F88 File Offset: 0x00006188
public void Reset()
{
this.m_position = -1;
}
// Token: 0x040000A1 RID: 161
private NameObjectCollectionBase m_collection;
// Token: 0x040000A2 RID: 162
private int m_position;
}
/// <summary>Represents a collection of the <see cref="T:System.String" /> keys of a collection. </summary>
// Token: 0x02000032 RID: 50
[Serializable]
public class KeysCollection : ICollection, IEnumerable
{
// Token: 0x06000201 RID: 513 RVA: 0x00007F94 File Offset: 0x00006194
internal KeysCollection(NameObjectCollectionBase collection)
{
this.m_collection = collection;
}
/// <summary>Copies the entire <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" /> to a compatible one-dimensional <see cref="T:System.Array" />, starting at the specified index of the target array.</summary>
/// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" />. The <see cref="T:System.Array" /> must have zero-based indexing. </param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or- The number of elements in the source <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />. </exception>
/// <exception cref="T:System.InvalidCastException">The type of the source <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" /> cannot be cast automatically to the type of the destination <paramref name="array" />. </exception>
// Token: 0x06000202 RID: 514 RVA: 0x00007FA4 File Offset: 0x000061A4
void ICollection.CopyTo(Array array, int arrayIndex)
{
ArrayList itemsArray = this.m_collection.m_ItemsArray;
if (array == null)
{
throw new ArgumentNullException("array");
}
if (arrayIndex < 0)
{
throw new ArgumentOutOfRangeException("arrayIndex");
}
if (array.Length > 0 && arrayIndex >= array.Length)
{
throw new ArgumentException("arrayIndex is equal to or greater than array.Length");
}
if (arrayIndex + itemsArray.Count > array.Length)
{
throw new ArgumentException("Not enough room from arrayIndex to end of array for this KeysCollection");
}
if (array != null && array.Rank > 1)
{
throw new ArgumentException("array is multidimensional");
}
object[] array2 = (object[])array;
int i = 0;
while (i < itemsArray.Count)
{
array2[arrayIndex] = ((NameObjectCollectionBase._Item)itemsArray[i]).key;
i++;
arrayIndex++;
}
}
/// <summary>Gets a value indicating whether access to the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" /> is synchronized (thread safe).</summary>
/// <returns>true if access to the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" /> is synchronized (thread safe); otherwise, false. The default is false.</returns>
// Token: 0x1700008C RID: 140
// (get) Token: 0x06000203 RID: 515 RVA: 0x00008078 File Offset: 0x00006278
bool ICollection.IsSynchronized
{
get
{
return false;
}
}
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" />.</summary>
/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" />.</returns>
// Token: 0x1700008D RID: 141
// (get) Token: 0x06000204 RID: 516 RVA: 0x0000807C File Offset: 0x0000627C
object ICollection.SyncRoot
{
get
{
return this.m_collection;
}
}
/// <summary>Gets the key at the specified index of the collection.</summary>
/// <returns>A <see cref="T:System.String" /> that contains the key at the specified index of the collection.</returns>
/// <param name="index">The zero-based index of the key to get from the collection. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is outside the valid range of indexes for the collection. </exception>
// Token: 0x06000205 RID: 517 RVA: 0x00008084 File Offset: 0x00006284
public virtual string Get(int index)
{
return this.m_collection.BaseGetKey(index);
}
/// <summary>Gets the number of keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" />.</summary>
/// <returns>The number of keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" />.</returns>
// Token: 0x1700008E RID: 142
// (get) Token: 0x06000206 RID: 518 RVA: 0x00008094 File Offset: 0x00006294
public int Count
{
get
{
return this.m_collection.Count;
}
}
/// <summary>Gets the entry at the specified index of the collection.</summary>
/// <returns>The <see cref="T:System.String" /> key of the entry at the specified index of the collection.</returns>
/// <param name="index">The zero-based index of the entry to locate in the collection. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is outside the valid range of indexes for the collection. </exception>
// Token: 0x1700008F RID: 143
public string this[int index]
{
get
{
return this.Get(index);
}
}
/// <summary>Returns an enumerator that iterates through the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" />.</summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" />.</returns>
// Token: 0x06000208 RID: 520 RVA: 0x000080B0 File Offset: 0x000062B0
public IEnumerator GetEnumerator()
{
return new NameObjectCollectionBase._KeysEnumerator(this.m_collection);
}
// Token: 0x040000A3 RID: 163
private NameObjectCollectionBase m_collection;
}
}
}
@@ -0,0 +1,501 @@
using System;
using System.Runtime.Serialization;
using System.Text;
namespace System.Collections.Specialized
{
/// <summary>Represents a collection of associated <see cref="T:System.String" /> keys and <see cref="T:System.String" /> values that can be accessed either with the key or with the index. </summary>
// Token: 0x02000033 RID: 51
[Serializable]
public class NameValueCollection : NameObjectCollectionBase
{
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameValueCollection" /> class that is empty, has the default initial capacity and uses the default case-insensitive hash code provider and the default case-insensitive comparer.</summary>
// Token: 0x06000209 RID: 521 RVA: 0x000080C0 File Offset: 0x000062C0
public NameValueCollection()
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameValueCollection" /> class that is empty, has the specified initial capacity and uses the default case-insensitive hash code provider and the default case-insensitive comparer.</summary>
/// <param name="capacity">The initial number of entries that the <see cref="T:System.Collections.Specialized.NameValueCollection" /> can contain.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="capacity" /> is less than zero.</exception>
// Token: 0x0600020A RID: 522 RVA: 0x000080C8 File Offset: 0x000062C8
public NameValueCollection(int capacity)
: base(capacity)
{
}
/// <summary>Copies the entries from the specified <see cref="T:System.Collections.Specialized.NameValueCollection" /> to a new <see cref="T:System.Collections.Specialized.NameValueCollection" /> with the same initial capacity as the number of entries copied and using the same hash code provider and the same comparer as the source collection.</summary>
/// <param name="col">The <see cref="T:System.Collections.Specialized.NameValueCollection" /> to copy to the new <see cref="T:System.Collections.Specialized.NameValueCollection" /> instance.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="col" /> is null.</exception>
// Token: 0x0600020B RID: 523 RVA: 0x000080D4 File Offset: 0x000062D4
public NameValueCollection(NameValueCollection col)
{
IEqualityComparer equalityComparer2;
if (col == null)
{
IEqualityComparer equalityComparer = null;
equalityComparer2 = equalityComparer;
}
else
{
equalityComparer2 = col.EqualityComparer;
}
IComparer comparer2;
if (col == null)
{
IComparer comparer = null;
comparer2 = comparer;
}
else
{
comparer2 = col.Comparer;
}
IHashCodeProvider hashCodeProvider2;
if (col == null)
{
IHashCodeProvider hashCodeProvider = null;
hashCodeProvider2 = hashCodeProvider;
}
else
{
hashCodeProvider2 = col.HashCodeProvider;
}
base..ctor(equalityComparer2, comparer2, hashCodeProvider2);
if (col == null)
{
throw new ArgumentNullException("col");
}
this.Add(col);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameValueCollection" /> class that is empty, has the default initial capacity and uses the specified hash code provider and the specified comparer.</summary>
/// <param name="hashProvider">The <see cref="T:System.Collections.IHashCodeProvider" /> that will supply the hash codes for all keys in the <see cref="T:System.Collections.Specialized.NameValueCollection" />.</param>
/// <param name="comparer">The <see cref="T:System.Collections.IComparer" /> to use to determine whether two keys are equal.</param>
// Token: 0x0600020C RID: 524 RVA: 0x0000813C File Offset: 0x0000633C
[Obsolete("Use NameValueCollection (IEqualityComparer)")]
public NameValueCollection(IHashCodeProvider hashProvider, IComparer comparer)
: base(hashProvider, comparer)
{
}
/// <summary>Copies the entries from the specified <see cref="T:System.Collections.Specialized.NameValueCollection" /> to a new <see cref="T:System.Collections.Specialized.NameValueCollection" /> with the specified initial capacity or the same initial capacity as the number of entries copied, whichever is greater, and using the default case-insensitive hash code provider and the default case-insensitive comparer.</summary>
/// <param name="capacity">The initial number of entries that the <see cref="T:System.Collections.Specialized.NameValueCollection" /> can contain.</param>
/// <param name="col">The <see cref="T:System.Collections.Specialized.NameValueCollection" /> to copy to the new <see cref="T:System.Collections.Specialized.NameValueCollection" /> instance.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="capacity" /> is less than zero.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="col" /> is null.</exception>
// Token: 0x0600020D RID: 525 RVA: 0x00008148 File Offset: 0x00006348
public NameValueCollection(int capacity, NameValueCollection col)
{
IHashCodeProvider hashCodeProvider2;
if (col == null)
{
IHashCodeProvider hashCodeProvider = null;
hashCodeProvider2 = hashCodeProvider;
}
else
{
hashCodeProvider2 = col.HashCodeProvider;
}
IComparer comparer2;
if (col == null)
{
IComparer comparer = null;
comparer2 = comparer;
}
else
{
comparer2 = col.Comparer;
}
base..ctor(capacity, hashCodeProvider2, comparer2);
this.Add(col);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameValueCollection" /> class that is serializable and uses the specified <see cref="T:System.Runtime.Serialization.SerializationInfo" /> and <see cref="T:System.Runtime.Serialization.StreamingContext" />.</summary>
/// <param name="info">A <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object that contains the information required to serialize the new <see cref="T:System.Collections.Specialized.NameValueCollection" /> instance.</param>
/// <param name="context">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> object that contains the source and destination of the serialized stream associated with the new <see cref="T:System.Collections.Specialized.NameValueCollection" /> instance.</param>
// Token: 0x0600020E RID: 526 RVA: 0x0000818C File Offset: 0x0000638C
protected NameValueCollection(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameValueCollection" /> class that is empty, has the specified initial capacity and uses the specified hash code provider and the specified comparer.</summary>
/// <param name="capacity">The initial number of entries that the <see cref="T:System.Collections.Specialized.NameValueCollection" /> can contain.</param>
/// <param name="hashProvider">The <see cref="T:System.Collections.IHashCodeProvider" /> that will supply the hash codes for all keys in the <see cref="T:System.Collections.Specialized.NameValueCollection" />.</param>
/// <param name="comparer">The <see cref="T:System.Collections.IComparer" /> to use to determine whether two keys are equal.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="capacity" /> is less than zero.</exception>
// Token: 0x0600020F RID: 527 RVA: 0x00008198 File Offset: 0x00006398
[Obsolete("Use NameValueCollection (IEqualityComparer)")]
public NameValueCollection(int capacity, IHashCodeProvider hashProvider, IComparer comparer)
: base(capacity, hashProvider, comparer)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameValueCollection" /> class that is empty, has the default initial capacity, and uses the specified <see cref="T:System.Collections.IEqualityComparer" /> object.</summary>
/// <param name="equalityComparer">The <see cref="T:System.Collections.IEqualityComparer" /> object to use to determine whether two keys are equal and to generate hash codes for the keys in the collection.</param>
// Token: 0x06000210 RID: 528 RVA: 0x000081A4 File Offset: 0x000063A4
public NameValueCollection(IEqualityComparer equalityComparer)
: base(equalityComparer)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameValueCollection" /> class that is empty, has the specified initial capacity, and uses the specified <see cref="T:System.Collections.IEqualityComparer" /> object.</summary>
/// <param name="capacity">The initial number of entries that the <see cref="T:System.Collections.Specialized.NameValueCollection" /> object can contain.</param>
/// <param name="equalityComparer">The <see cref="T:System.Collections.IEqualityComparer" /> object to use to determine whether two keys are equal and to generate hash codes for the keys in the collection.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="capacity" /> is less than zero.</exception>
// Token: 0x06000211 RID: 529 RVA: 0x000081B0 File Offset: 0x000063B0
public NameValueCollection(int capacity, IEqualityComparer equalityComparer)
: base(capacity, equalityComparer)
{
}
/// <summary>Gets all the keys in the <see cref="T:System.Collections.Specialized.NameValueCollection" />.</summary>
/// <returns>A <see cref="T:System.String" /> array that contains all the keys of the <see cref="T:System.Collections.Specialized.NameValueCollection" />.</returns>
// Token: 0x17000090 RID: 144
// (get) Token: 0x06000212 RID: 530 RVA: 0x000081BC File Offset: 0x000063BC
public virtual string[] AllKeys
{
get
{
if (this.cachedAllKeys == null)
{
this.cachedAllKeys = base.BaseGetAllKeys();
}
return this.cachedAllKeys;
}
}
/// <summary>Gets the entry at the specified index of the <see cref="T:System.Collections.Specialized.NameValueCollection" />.</summary>
/// <returns>A <see cref="T:System.String" /> that contains the comma-separated list of values at the specified index of the collection.</returns>
/// <param name="index">The zero-based index of the entry to locate in the collection.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is outside the valid range of indexes for the collection.</exception>
// Token: 0x17000091 RID: 145
public string this[int index]
{
get
{
return this.Get(index);
}
}
/// <summary>Gets or sets the entry with the specified key in the <see cref="T:System.Collections.Specialized.NameValueCollection" />.</summary>
/// <returns>A <see cref="T:System.String" /> that contains the comma-separated list of values associated with the specified key, if found; otherwise, null.</returns>
/// <param name="name">The <see cref="T:System.String" /> key of the entry to locate. The key can be null.</param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only and the operation attempts to modify the collection. </exception>
// Token: 0x17000092 RID: 146
public string this[string name]
{
get
{
return this.Get(name);
}
set
{
this.Set(name, value);
}
}
/// <summary>Copies the entries in the specified <see cref="T:System.Collections.Specialized.NameValueCollection" /> to the current <see cref="T:System.Collections.Specialized.NameValueCollection" />.</summary>
/// <param name="c">The <see cref="T:System.Collections.Specialized.NameValueCollection" /> to copy to the current <see cref="T:System.Collections.Specialized.NameValueCollection" />.</param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="c" /> is null.</exception>
// Token: 0x06000216 RID: 534 RVA: 0x00008200 File Offset: 0x00006400
public void Add(NameValueCollection c)
{
if (base.IsReadOnly)
{
throw new NotSupportedException("Collection is read-only");
}
if (c == null)
{
throw new ArgumentNullException("c");
}
this.InvalidateCachedArrays();
int count = c.Count;
for (int i = 0; i < count; i++)
{
string key = c.GetKey(i);
ArrayList arrayList = (ArrayList)c.BaseGet(i);
ArrayList arrayList2 = (ArrayList)base.BaseGet(key);
if (arrayList2 != null && arrayList != null)
{
arrayList2.AddRange(arrayList);
}
else if (arrayList != null)
{
arrayList2 = new ArrayList(arrayList);
}
base.BaseSet(key, arrayList2);
}
}
/// <summary>Adds an entry with the specified name and value to the <see cref="T:System.Collections.Specialized.NameValueCollection" />.</summary>
/// <param name="name">The <see cref="T:System.String" /> key of the entry to add. The key can be null.</param>
/// <param name="value">The <see cref="T:System.String" /> value of the entry to add. The value can be null.</param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only. </exception>
// Token: 0x06000217 RID: 535 RVA: 0x000082A8 File Offset: 0x000064A8
public virtual void Add(string name, string val)
{
if (base.IsReadOnly)
{
throw new NotSupportedException("Collection is read-only");
}
this.InvalidateCachedArrays();
ArrayList arrayList = (ArrayList)base.BaseGet(name);
if (arrayList == null)
{
arrayList = new ArrayList();
if (val != null)
{
arrayList.Add(val);
}
base.BaseAdd(name, arrayList);
}
else if (val != null)
{
arrayList.Add(val);
}
}
/// <summary>Invalidates the cached arrays and removes all entries from the <see cref="T:System.Collections.Specialized.NameValueCollection" />.</summary>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x06000218 RID: 536 RVA: 0x00008314 File Offset: 0x00006514
public virtual void Clear()
{
if (base.IsReadOnly)
{
throw new NotSupportedException("Collection is read-only");
}
this.InvalidateCachedArrays();
base.BaseClear();
}
/// <summary>Copies the entire <see cref="T:System.Collections.Specialized.NameValueCollection" /> to a compatible one-dimensional <see cref="T:System.Array" />, starting at the specified index of the target array.</summary>
/// <param name="dest">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from <see cref="T:System.Collections.Specialized.NameValueCollection" />. The <see cref="T:System.Array" /> must have zero-based indexing.</param>
/// <param name="index">The zero-based index in <paramref name="dest" /> at which copying begins.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="dest" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="dest" /> is multidimensional.-or- The number of elements in the source <see cref="T:System.Collections.Specialized.NameValueCollection" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="dest" />.</exception>
/// <exception cref="T:System.InvalidCastException">The type of the source <see cref="T:System.Collections.Specialized.NameValueCollection" /> cannot be cast automatically to the type of the destination <paramref name="dest" />.</exception>
// Token: 0x06000219 RID: 537 RVA: 0x00008344 File Offset: 0x00006544
public void CopyTo(Array dest, int index)
{
if (dest == null)
{
throw new ArgumentNullException("dest", "Null argument - dest");
}
if (index < 0)
{
throw new ArgumentOutOfRangeException("index", "index is less than 0");
}
if (dest.Rank > 1)
{
throw new ArgumentException("dest", "multidim");
}
if (this.cachedAll == null)
{
this.RefreshCachedAll();
}
try
{
this.cachedAll.CopyTo(dest, index);
}
catch (ArrayTypeMismatchException)
{
throw new InvalidCastException();
}
}
// Token: 0x0600021A RID: 538 RVA: 0x000083E8 File Offset: 0x000065E8
private void RefreshCachedAll()
{
this.cachedAll = null;
int count = this.Count;
this.cachedAll = new string[count];
for (int i = 0; i < count; i++)
{
this.cachedAll[i] = this.Get(i);
}
}
/// <summary>Gets the values at the specified index of the <see cref="T:System.Collections.Specialized.NameValueCollection" /> combined into one comma-separated list.</summary>
/// <returns>A <see cref="T:System.String" /> that contains a comma-separated list of the values at the specified index of the <see cref="T:System.Collections.Specialized.NameValueCollection" />, if found; otherwise, null.</returns>
/// <param name="index">The zero-based index of the entry that contains the values to get from the collection.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is outside the valid range of indexes for the collection.</exception>
// Token: 0x0600021B RID: 539 RVA: 0x00008430 File Offset: 0x00006630
public virtual string Get(int index)
{
ArrayList arrayList = (ArrayList)base.BaseGet(index);
return NameValueCollection.AsSingleString(arrayList);
}
/// <summary>Gets the values associated with the specified key from the <see cref="T:System.Collections.Specialized.NameValueCollection" /> combined into one comma-separated list.</summary>
/// <returns>A <see cref="T:System.String" /> that contains a comma-separated list of the values associated with the specified key from the <see cref="T:System.Collections.Specialized.NameValueCollection" />, if found; otherwise, null.</returns>
/// <param name="name">The <see cref="T:System.String" /> key of the entry that contains the values to get. The key can be null.</param>
// Token: 0x0600021C RID: 540 RVA: 0x00008450 File Offset: 0x00006650
public virtual string Get(string name)
{
ArrayList arrayList = (ArrayList)base.BaseGet(name);
return NameValueCollection.AsSingleString(arrayList);
}
// Token: 0x0600021D RID: 541 RVA: 0x00008470 File Offset: 0x00006670
private static string AsSingleString(ArrayList values)
{
if (values == null)
{
return null;
}
int count = values.Count;
switch (count)
{
case 0:
return null;
case 1:
return (string)values[0];
case 2:
return (string)values[0] + ',' + (string)values[1];
default:
{
int num = count;
for (int i = 0; i < count; i++)
{
num += ((string)values[i]).Length;
}
StringBuilder stringBuilder = new StringBuilder((string)values[0], num);
for (int j = 1; j < count; j++)
{
stringBuilder.Append(',');
stringBuilder.Append(values[j]);
}
return stringBuilder.ToString();
}
}
}
/// <summary>Gets the key at the specified index of the <see cref="T:System.Collections.Specialized.NameValueCollection" />.</summary>
/// <returns>A <see cref="T:System.String" /> that contains the key at the specified index of the <see cref="T:System.Collections.Specialized.NameValueCollection" />, if found; otherwise, null.</returns>
/// <param name="index">The zero-based index of the key to get from the collection.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is outside the valid range of indexes for the collection. </exception>
// Token: 0x0600021E RID: 542 RVA: 0x00008550 File Offset: 0x00006750
public virtual string GetKey(int index)
{
return base.BaseGetKey(index);
}
/// <summary>Gets the values at the specified index of the <see cref="T:System.Collections.Specialized.NameValueCollection" />.</summary>
/// <returns>A <see cref="T:System.String" /> array that contains the values at the specified index of the <see cref="T:System.Collections.Specialized.NameValueCollection" />, if found; otherwise, null.</returns>
/// <param name="index">The zero-based index of the entry that contains the values to get from the collection.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is outside the valid range of indexes for the collection. </exception>
// Token: 0x0600021F RID: 543 RVA: 0x0000855C File Offset: 0x0000675C
public virtual string[] GetValues(int index)
{
ArrayList arrayList = (ArrayList)base.BaseGet(index);
return NameValueCollection.AsStringArray(arrayList);
}
/// <summary>Gets the values associated with the specified key from the <see cref="T:System.Collections.Specialized.NameValueCollection" />.</summary>
/// <returns>A <see cref="T:System.String" /> array that contains the values associated with the specified key from the <see cref="T:System.Collections.Specialized.NameValueCollection" />, if found; otherwise, null.</returns>
/// <param name="name">The <see cref="T:System.String" /> key of the entry that contains the values to get. The key can be null.</param>
// Token: 0x06000220 RID: 544 RVA: 0x0000857C File Offset: 0x0000677C
public virtual string[] GetValues(string name)
{
ArrayList arrayList = (ArrayList)base.BaseGet(name);
return NameValueCollection.AsStringArray(arrayList);
}
// Token: 0x06000221 RID: 545 RVA: 0x0000859C File Offset: 0x0000679C
private static string[] AsStringArray(ArrayList values)
{
if (values == null)
{
return null;
}
int count = values.Count;
if (count == 0)
{
return null;
}
string[] array = new string[count];
values.CopyTo(array);
return array;
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.Specialized.NameValueCollection" /> contains keys that are not null.</summary>
/// <returns>true if the <see cref="T:System.Collections.Specialized.NameValueCollection" /> contains keys that are not null; otherwise, false.</returns>
// Token: 0x06000222 RID: 546 RVA: 0x000085D0 File Offset: 0x000067D0
public bool HasKeys()
{
return base.BaseHasKeys();
}
/// <summary>Removes the entries with the specified key from the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
/// <param name="name">The <see cref="T:System.String" /> key of the entry to remove. The key can be null.</param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
// Token: 0x06000223 RID: 547 RVA: 0x000085D8 File Offset: 0x000067D8
public virtual void Remove(string name)
{
if (base.IsReadOnly)
{
throw new NotSupportedException("Collection is read-only");
}
this.InvalidateCachedArrays();
base.BaseRemove(name);
}
/// <summary>Sets the value of an entry in the <see cref="T:System.Collections.Specialized.NameValueCollection" />.</summary>
/// <param name="name">The <see cref="T:System.String" /> key of the entry to add the new value to. The key can be null.</param>
/// <param name="value">The <see cref="T:System.Object" /> that represents the new value to add to the specified entry. The value can be null.</param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
// Token: 0x06000224 RID: 548 RVA: 0x00008600 File Offset: 0x00006800
public virtual void Set(string name, string value)
{
if (base.IsReadOnly)
{
throw new NotSupportedException("Collection is read-only");
}
this.InvalidateCachedArrays();
ArrayList arrayList = new ArrayList();
if (value != null)
{
arrayList.Add(value);
base.BaseSet(name, arrayList);
}
else
{
base.BaseSet(name, null);
}
}
/// <summary>Resets the cached arrays of the collection to null.</summary>
// Token: 0x06000225 RID: 549 RVA: 0x00008654 File Offset: 0x00006854
protected void InvalidateCachedArrays()
{
this.cachedAllKeys = null;
this.cachedAll = null;
}
// Token: 0x040000A4 RID: 164
private string[] cachedAllKeys;
// Token: 0x040000A5 RID: 165
private string[] cachedAll;
}
}
@@ -0,0 +1,584 @@
using System;
using System.Runtime.Serialization;
namespace System.Collections.Specialized
{
/// <summary>Represents a collection of key/value pairs that are accessible by the key or index.</summary>
// Token: 0x02000034 RID: 52
[Serializable]
public class OrderedDictionary : ICollection, IOrderedDictionary, IDictionary, IDeserializationCallback, IEnumerable, ISerializable
{
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> class.</summary>
// Token: 0x06000226 RID: 550 RVA: 0x00008664 File Offset: 0x00006864
public OrderedDictionary()
{
this.list = new ArrayList();
this.hash = new Hashtable();
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> class using the specified initial capacity.</summary>
/// <param name="capacity">The initial number of elements that the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection can contain.</param>
// Token: 0x06000227 RID: 551 RVA: 0x00008684 File Offset: 0x00006884
public OrderedDictionary(int capacity)
{
this.initialCapacity = ((capacity >= 0) ? capacity : 0);
this.list = new ArrayList(this.initialCapacity);
this.hash = new Hashtable(this.initialCapacity);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> class using the specified comparer.</summary>
/// <param name="comparer">The <see cref="T:System.Collections.IComparer" /> to use to determine whether two keys are equal.-or- null to use the default comparer, which is each key's implementation of <see cref="M:System.Object.Equals(System.Object)" />.</param>
// Token: 0x06000228 RID: 552 RVA: 0x000086D0 File Offset: 0x000068D0
public OrderedDictionary(IEqualityComparer equalityComparer)
{
this.list = new ArrayList();
this.hash = new Hashtable(equalityComparer);
this.comparer = equalityComparer;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> class using the specified initial capacity and comparer.</summary>
/// <param name="capacity">The initial number of elements that the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection can contain.</param>
/// <param name="comparer">The <see cref="T:System.Collections.IComparer" /> to use to determine whether two keys are equal.-or- null to use the default comparer, which is each key's implementation of <see cref="M:System.Object.Equals(System.Object)" />.</param>
// Token: 0x06000229 RID: 553 RVA: 0x00008704 File Offset: 0x00006904
public OrderedDictionary(int capacity, IEqualityComparer equalityComparer)
{
this.initialCapacity = ((capacity >= 0) ? capacity : 0);
this.list = new ArrayList(this.initialCapacity);
this.hash = new Hashtable(this.initialCapacity, equalityComparer);
this.comparer = equalityComparer;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> class that is serializable using the specified <see cref="T:System.Runtime.Serialization.SerializationInfo" /> and <see cref="T:System.Runtime.Serialization.StreamingContext" /> objects.</summary>
/// <param name="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.</param>
/// <param name="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" />.</param>
// Token: 0x0600022A RID: 554 RVA: 0x00008758 File Offset: 0x00006958
protected OrderedDictionary(SerializationInfo info, StreamingContext context)
{
this.serializationInfo = info;
}
/// <summary>Implements the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface and is called back by the deserialization event when deserialization is complete.</summary>
/// <param name="sender">The source of the deserialization event.</param>
// Token: 0x0600022B RID: 555 RVA: 0x00008768 File Offset: 0x00006968
void IDeserializationCallback.OnDeserialization(object sender)
{
if (this.serializationInfo == null)
{
return;
}
this.comparer = (IEqualityComparer)this.serializationInfo.GetValue("KeyComparer", typeof(IEqualityComparer));
this.readOnly = this.serializationInfo.GetBoolean("ReadOnly");
this.initialCapacity = this.serializationInfo.GetInt32("InitialCapacity");
if (this.list == null)
{
this.list = new ArrayList();
}
else
{
this.list.Clear();
}
this.hash = new Hashtable(this.comparer);
object[] array = (object[])this.serializationInfo.GetValue("ArrayList", typeof(object[]));
foreach (DictionaryEntry dictionaryEntry in array)
{
this.hash.Add(dictionaryEntry.Key, dictionaryEntry.Value);
this.list.Add(dictionaryEntry);
}
}
/// <summary>Returns an <see cref="T:System.Collections.IDictionaryEnumerator" /> object that iterates through the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.</summary>
/// <returns>An <see cref="T:System.Collections.IDictionaryEnumerator" /> object for the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.</returns>
// Token: 0x0600022C RID: 556 RVA: 0x00008874 File Offset: 0x00006A74
IEnumerator IEnumerable.GetEnumerator()
{
return this.list.GetEnumerator();
}
/// <summary>Gets a value indicating whether access to the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> object is synchronized (thread-safe).</summary>
/// <returns>This method always returns false.</returns>
// Token: 0x17000093 RID: 147
// (get) Token: 0x0600022D RID: 557 RVA: 0x00008884 File Offset: 0x00006A84
bool ICollection.IsSynchronized
{
get
{
return this.list.IsSynchronized;
}
}
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> object.</summary>
/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> object.</returns>
// Token: 0x17000094 RID: 148
// (get) Token: 0x0600022E RID: 558 RVA: 0x00008894 File Offset: 0x00006A94
object ICollection.SyncRoot
{
get
{
return this.list.SyncRoot;
}
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> has a fixed size.</summary>
/// <returns>true if the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> has a fixed size; otherwise, false. The default is false.</returns>
// Token: 0x17000095 RID: 149
// (get) Token: 0x0600022F RID: 559 RVA: 0x000088A4 File Offset: 0x00006AA4
bool IDictionary.IsFixedSize
{
get
{
return false;
}
}
/// <summary>Implements the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface and is called back by the deserialization event when deserialization is complete.</summary>
/// <param name="sender">The source of the deserialization event.</param>
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object associated with the current <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection is invalid.</exception>
// Token: 0x06000230 RID: 560 RVA: 0x000088A8 File Offset: 0x00006AA8
protected virtual void OnDeserialization(object sender)
{
((IDeserializationCallback)this).OnDeserialization(sender);
}
/// <summary>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.</summary>
/// <param name="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.</param>
/// <param name="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" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="info" /> is null.</exception>
// Token: 0x06000231 RID: 561 RVA: 0x000088B4 File Offset: 0x00006AB4
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
info.AddValue("KeyComparer", this.comparer, typeof(IEqualityComparer));
info.AddValue("ReadOnly", this.readOnly);
info.AddValue("InitialCapacity", this.initialCapacity);
object[] array = new object[this.hash.Count];
this.hash.CopyTo(array, 0);
info.AddValue("ArrayList", array);
}
/// <summary>Gets the number of key/values pairs contained in the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.</summary>
/// <returns>The number of key/value pairs contained in the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.</returns>
// Token: 0x17000096 RID: 150
// (get) Token: 0x06000232 RID: 562 RVA: 0x0000893C File Offset: 0x00006B3C
public int Count
{
get
{
return this.list.Count;
}
}
/// <summary>Copies the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> elements to a one-dimensional <see cref="T:System.Array" /> object at the specified index.</summary>
/// <param name="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.</param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins.</param>
// Token: 0x06000233 RID: 563 RVA: 0x0000894C File Offset: 0x00006B4C
public void CopyTo(Array array, int index)
{
this.list.CopyTo(array, index);
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection is read-only.</summary>
/// <returns>true if the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection is read-only; otherwise, false. The default is false.</returns>
// Token: 0x17000097 RID: 151
// (get) Token: 0x06000234 RID: 564 RVA: 0x0000895C File Offset: 0x00006B5C
public bool IsReadOnly
{
get
{
return this.readOnly;
}
}
/// <summary>Gets or sets the value with the specified key.</summary>
/// <returns>The value associated with the specified key. If the specified key is not found, attempting to get it returns null, and attempting to set it creates a new element using the specified key.</returns>
/// <param name="key">The key of the value to get or set.</param>
/// <exception cref="T:System.NotSupportedException">The property is being set and the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection is read-only.</exception>
// Token: 0x17000098 RID: 152
public object this[object key]
{
get
{
return this.hash[key];
}
set
{
this.WriteCheck();
if (this.hash.Contains(key))
{
int num = this.FindListEntry(key);
this.list[num] = new DictionaryEntry(key, value);
}
else
{
this.list.Add(new DictionaryEntry(key, value));
}
this.hash[key] = value;
}
}
/// <summary>Gets or sets the value at the specified index.</summary>
/// <returns>The value of the item at the specified index. </returns>
/// <param name="index">The zero-based index of the value to get or set.</param>
/// <exception cref="T:System.NotSupportedException">The property is being set and the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection is read-only.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero.-or-<paramref name="index" /> is equal to or greater than <see cref="P:System.Collections.Specialized.OrderedDictionary.Count" />.</exception>
// Token: 0x17000099 RID: 153
public object this[int index]
{
get
{
return ((DictionaryEntry)this.list[index]).Value;
}
set
{
this.WriteCheck();
DictionaryEntry dictionaryEntry = (DictionaryEntry)this.list[index];
dictionaryEntry.Value = value;
this.list[index] = dictionaryEntry;
this.hash[dictionaryEntry.Key] = value;
}
}
/// <summary>Gets an <see cref="T:System.Collections.ICollection" /> object containing the keys in the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.</summary>
/// <returns>An <see cref="T:System.Collections.ICollection" /> object containing the keys in the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.</returns>
// Token: 0x1700009A RID: 154
// (get) Token: 0x06000239 RID: 569 RVA: 0x00008A60 File Offset: 0x00006C60
public ICollection Keys
{
get
{
return new OrderedDictionary.OrderedCollection(this.list, true);
}
}
/// <summary>Gets an <see cref="T:System.Collections.ICollection" /> object containing the values in the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.</summary>
/// <returns>An <see cref="T:System.Collections.ICollection" /> object containing the values in the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.</returns>
// Token: 0x1700009B RID: 155
// (get) Token: 0x0600023A RID: 570 RVA: 0x00008A70 File Offset: 0x00006C70
public ICollection Values
{
get
{
return new OrderedDictionary.OrderedCollection(this.list, false);
}
}
/// <summary>Adds an entry with the specified key and value into the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection with the lowest available index.</summary>
/// <param name="key">The key of the entry to add.</param>
/// <param name="value">The value of the entry to add. This value can be null.</param>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection is read-only.</exception>
// Token: 0x0600023B RID: 571 RVA: 0x00008A80 File Offset: 0x00006C80
public void Add(object key, object value)
{
this.WriteCheck();
this.hash.Add(key, value);
this.list.Add(new DictionaryEntry(key, value));
}
/// <summary>Removes all elements from the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.</summary>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection is read-only.</exception>
// Token: 0x0600023C RID: 572 RVA: 0x00008AB0 File Offset: 0x00006CB0
public void Clear()
{
this.WriteCheck();
this.hash.Clear();
this.list.Clear();
}
/// <summary>Determines whether the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection contains a specific key.</summary>
/// <returns>true if the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection contains an element with the specified key; otherwise, false.</returns>
/// <param name="key">The key to locate in the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.</param>
// Token: 0x0600023D RID: 573 RVA: 0x00008AD0 File Offset: 0x00006CD0
public bool Contains(object key)
{
return this.hash.Contains(key);
}
/// <summary>Returns an <see cref="T:System.Collections.IDictionaryEnumerator" /> object that iterates through the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.</summary>
/// <returns>An <see cref="T:System.Collections.IDictionaryEnumerator" /> object for the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.</returns>
// Token: 0x0600023E RID: 574 RVA: 0x00008AE0 File Offset: 0x00006CE0
public virtual IDictionaryEnumerator GetEnumerator()
{
return new OrderedDictionary.OrderedEntryCollectionEnumerator(this.list.GetEnumerator());
}
/// <summary>Removes the entry with the specified key from the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.</summary>
/// <param name="key">The key of the entry to remove.</param>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection is read-only.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x0600023F RID: 575 RVA: 0x00008AF4 File Offset: 0x00006CF4
public void Remove(object key)
{
this.WriteCheck();
if (this.hash.Contains(key))
{
this.hash.Remove(key);
int num = this.FindListEntry(key);
this.list.RemoveAt(num);
}
}
// Token: 0x06000240 RID: 576 RVA: 0x00008B38 File Offset: 0x00006D38
private int FindListEntry(object key)
{
for (int i = 0; i < this.list.Count; i++)
{
DictionaryEntry dictionaryEntry = (DictionaryEntry)this.list[i];
if ((this.comparer == null) ? dictionaryEntry.Key.Equals(key) : this.comparer.Equals(dictionaryEntry.Key, key))
{
return i;
}
}
return -1;
}
// Token: 0x06000241 RID: 577 RVA: 0x00008BAC File Offset: 0x00006DAC
private void WriteCheck()
{
if (this.readOnly)
{
throw new NotSupportedException("Collection is read only");
}
}
/// <summary>Returns a read-only copy of the current <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.</summary>
/// <returns>A read-only copy of the current <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.</returns>
// Token: 0x06000242 RID: 578 RVA: 0x00008BC4 File Offset: 0x00006DC4
public OrderedDictionary AsReadOnly()
{
return new OrderedDictionary
{
list = this.list,
hash = this.hash,
comparer = this.comparer,
readOnly = true
};
}
/// <summary>Inserts a new entry into the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection with the specified key and value at the specified index.</summary>
/// <param name="index">The zero-based index at which the element should be inserted.</param>
/// <param name="key">The key of the entry to add.</param>
/// <param name="value">The value of the entry to add. The value can be null.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is out of range.</exception>
/// <exception cref="T:System.NotSupportedException">This collection is read-only.</exception>
// Token: 0x06000243 RID: 579 RVA: 0x00008C04 File Offset: 0x00006E04
public void Insert(int index, object key, object value)
{
this.WriteCheck();
this.hash.Add(key, value);
this.list.Insert(index, new DictionaryEntry(key, value));
}
/// <summary>Removes the entry at the specified index from the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection.</summary>
/// <param name="index">The zero-based index of the entry to remove.</param>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Specialized.OrderedDictionary" /> collection is read-only.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero.- or -<paramref name="index" /> is equal to or greater than <see cref="P:System.Collections.Specialized.OrderedDictionary.Count" />.</exception>
// Token: 0x06000244 RID: 580 RVA: 0x00008C3C File Offset: 0x00006E3C
public void RemoveAt(int index)
{
this.WriteCheck();
DictionaryEntry dictionaryEntry = (DictionaryEntry)this.list[index];
this.list.RemoveAt(index);
this.hash.Remove(dictionaryEntry.Key);
}
// Token: 0x040000A6 RID: 166
private ArrayList list;
// Token: 0x040000A7 RID: 167
private Hashtable hash;
// Token: 0x040000A8 RID: 168
private bool readOnly;
// Token: 0x040000A9 RID: 169
private int initialCapacity;
// Token: 0x040000AA RID: 170
private SerializationInfo serializationInfo;
// Token: 0x040000AB RID: 171
private IEqualityComparer comparer;
// Token: 0x02000035 RID: 53
private class OrderedEntryCollectionEnumerator : IEnumerator, IDictionaryEnumerator
{
// Token: 0x06000245 RID: 581 RVA: 0x00008C80 File Offset: 0x00006E80
public OrderedEntryCollectionEnumerator(IEnumerator listEnumerator)
{
this.listEnumerator = listEnumerator;
}
// Token: 0x06000246 RID: 582 RVA: 0x00008C90 File Offset: 0x00006E90
public bool MoveNext()
{
return this.listEnumerator.MoveNext();
}
// Token: 0x06000247 RID: 583 RVA: 0x00008CA0 File Offset: 0x00006EA0
public void Reset()
{
this.listEnumerator.Reset();
}
// Token: 0x1700009C RID: 156
// (get) Token: 0x06000248 RID: 584 RVA: 0x00008CB0 File Offset: 0x00006EB0
public object Current
{
get
{
return this.listEnumerator.Current;
}
}
// Token: 0x1700009D RID: 157
// (get) Token: 0x06000249 RID: 585 RVA: 0x00008CC0 File Offset: 0x00006EC0
public DictionaryEntry Entry
{
get
{
return (DictionaryEntry)this.listEnumerator.Current;
}
}
// Token: 0x1700009E RID: 158
// (get) Token: 0x0600024A RID: 586 RVA: 0x00008CD4 File Offset: 0x00006ED4
public object Key
{
get
{
return this.Entry.Key;
}
}
// Token: 0x1700009F RID: 159
// (get) Token: 0x0600024B RID: 587 RVA: 0x00008CF0 File Offset: 0x00006EF0
public object Value
{
get
{
return this.Entry.Value;
}
}
// Token: 0x040000AC RID: 172
private IEnumerator listEnumerator;
}
// Token: 0x02000036 RID: 54
private class OrderedCollection : ICollection, IEnumerable
{
// Token: 0x0600024C RID: 588 RVA: 0x00008D0C File Offset: 0x00006F0C
public OrderedCollection(ArrayList list, bool isKeyList)
{
this.list = list;
this.isKeyList = isKeyList;
}
// Token: 0x170000A0 RID: 160
// (get) Token: 0x0600024D RID: 589 RVA: 0x00008D24 File Offset: 0x00006F24
public int Count
{
get
{
return this.list.Count;
}
}
// Token: 0x170000A1 RID: 161
// (get) Token: 0x0600024E RID: 590 RVA: 0x00008D34 File Offset: 0x00006F34
public bool IsSynchronized
{
get
{
return false;
}
}
// Token: 0x170000A2 RID: 162
// (get) Token: 0x0600024F RID: 591 RVA: 0x00008D38 File Offset: 0x00006F38
public object SyncRoot
{
get
{
return this.list.SyncRoot;
}
}
// Token: 0x06000250 RID: 592 RVA: 0x00008D48 File Offset: 0x00006F48
public void CopyTo(Array array, int index)
{
for (int i = 0; i < this.list.Count; i++)
{
DictionaryEntry dictionaryEntry = (DictionaryEntry)this.list[i];
if (this.isKeyList)
{
array.SetValue(dictionaryEntry.Key, index + i);
}
else
{
array.SetValue(dictionaryEntry.Value, index + i);
}
}
}
// Token: 0x06000251 RID: 593 RVA: 0x00008DB4 File Offset: 0x00006FB4
public IEnumerator GetEnumerator()
{
return new OrderedDictionary.OrderedCollection.OrderedCollectionEnumerator(this.list.GetEnumerator(), this.isKeyList);
}
// Token: 0x040000AD RID: 173
private ArrayList list;
// Token: 0x040000AE RID: 174
private bool isKeyList;
// Token: 0x02000037 RID: 55
private class OrderedCollectionEnumerator : IEnumerator
{
// Token: 0x06000252 RID: 594 RVA: 0x00008DCC File Offset: 0x00006FCC
public OrderedCollectionEnumerator(IEnumerator listEnumerator, bool isKeyList)
{
this.listEnumerator = listEnumerator;
this.isKeyList = isKeyList;
}
// Token: 0x170000A3 RID: 163
// (get) Token: 0x06000253 RID: 595 RVA: 0x00008DE4 File Offset: 0x00006FE4
public object Current
{
get
{
DictionaryEntry dictionaryEntry = (DictionaryEntry)this.listEnumerator.Current;
return (!this.isKeyList) ? dictionaryEntry.Value : dictionaryEntry.Key;
}
}
// Token: 0x06000254 RID: 596 RVA: 0x00008E20 File Offset: 0x00007020
public bool MoveNext()
{
return this.listEnumerator.MoveNext();
}
// Token: 0x06000255 RID: 597 RVA: 0x00008E30 File Offset: 0x00007030
public void Reset()
{
this.listEnumerator.Reset();
}
// Token: 0x040000AF RID: 175
private bool isKeyList;
// Token: 0x040000B0 RID: 176
private IEnumerator listEnumerator;
}
}
}
}
@@ -0,0 +1,130 @@
using System;
namespace System.Collections.Specialized
{
// Token: 0x02000038 RID: 56
internal class ProcessStringDictionary : StringDictionary, IEnumerable
{
// Token: 0x06000256 RID: 598 RVA: 0x00008E40 File Offset: 0x00007040
public ProcessStringDictionary()
{
IHashCodeProvider hashCodeProvider = null;
IComparer comparer = null;
int platform = (int)Environment.OSVersion.Platform;
if (platform != 4 && platform != 128)
{
hashCodeProvider = CaseInsensitiveHashCodeProvider.DefaultInvariant;
comparer = CaseInsensitiveComparer.DefaultInvariant;
}
this.table = new Hashtable(hashCodeProvider, comparer);
}
// Token: 0x170000A4 RID: 164
// (get) Token: 0x06000257 RID: 599 RVA: 0x00008E90 File Offset: 0x00007090
public override int Count
{
get
{
return this.table.Count;
}
}
// Token: 0x170000A5 RID: 165
// (get) Token: 0x06000258 RID: 600 RVA: 0x00008EA0 File Offset: 0x000070A0
public override bool IsSynchronized
{
get
{
return false;
}
}
// Token: 0x170000A6 RID: 166
public override string this[string key]
{
get
{
return (string)this.table[key];
}
set
{
this.table[key] = value;
}
}
// Token: 0x170000A7 RID: 167
// (get) Token: 0x0600025B RID: 603 RVA: 0x00008EC8 File Offset: 0x000070C8
public override ICollection Keys
{
get
{
return this.table.Keys;
}
}
// Token: 0x170000A8 RID: 168
// (get) Token: 0x0600025C RID: 604 RVA: 0x00008ED8 File Offset: 0x000070D8
public override ICollection Values
{
get
{
return this.table.Values;
}
}
// Token: 0x170000A9 RID: 169
// (get) Token: 0x0600025D RID: 605 RVA: 0x00008EE8 File Offset: 0x000070E8
public override object SyncRoot
{
get
{
return this.table.SyncRoot;
}
}
// Token: 0x0600025E RID: 606 RVA: 0x00008EF8 File Offset: 0x000070F8
public override void Add(string key, string value)
{
this.table.Add(key, value);
}
// Token: 0x0600025F RID: 607 RVA: 0x00008F08 File Offset: 0x00007108
public override void Clear()
{
this.table.Clear();
}
// Token: 0x06000260 RID: 608 RVA: 0x00008F18 File Offset: 0x00007118
public override bool ContainsKey(string key)
{
return this.table.ContainsKey(key);
}
// Token: 0x06000261 RID: 609 RVA: 0x00008F28 File Offset: 0x00007128
public override bool ContainsValue(string value)
{
return this.table.ContainsValue(value);
}
// Token: 0x06000262 RID: 610 RVA: 0x00008F38 File Offset: 0x00007138
public override void CopyTo(Array array, int index)
{
this.table.CopyTo(array, index);
}
// Token: 0x06000263 RID: 611 RVA: 0x00008F48 File Offset: 0x00007148
public override IEnumerator GetEnumerator()
{
return this.table.GetEnumerator();
}
// Token: 0x06000264 RID: 612 RVA: 0x00008F58 File Offset: 0x00007158
public override void Remove(string key)
{
this.table.Remove(key);
}
// Token: 0x040000B1 RID: 177
private Hashtable table;
}
}
@@ -0,0 +1,295 @@
using System;
namespace System.Collections.Specialized
{
/// <summary>Represents a collection of strings.</summary>
// Token: 0x02000039 RID: 57
[Serializable]
public class StringCollection : ICollection, IEnumerable, IList
{
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.Specialized.StringCollection" /> object is read-only.</summary>
/// <returns>true if the <see cref="T:System.Collections.Specialized.StringCollection" /> object is read-only; otherwise, false. The default is false.</returns>
// Token: 0x170000AA RID: 170
// (get) Token: 0x06000266 RID: 614 RVA: 0x00008F7C File Offset: 0x0000717C
bool IList.IsReadOnly
{
get
{
return false;
}
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.Specialized.StringCollection" /> object has a fixed size.</summary>
/// <returns>true if the <see cref="T:System.Collections.Specialized.StringCollection" /> object has a fixed size; otherwise, false. The default is false.</returns>
// Token: 0x170000AB RID: 171
// (get) Token: 0x06000267 RID: 615 RVA: 0x00008F80 File Offset: 0x00007180
bool IList.IsFixedSize
{
get
{
return false;
}
}
/// <summary>Gets or sets the element at the specified index.</summary>
/// <returns>The element at the specified index.</returns>
/// <param name="index">The zero-based index of the element to get or set. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero.-or- <paramref name="index" /> is equal to or greater than <see cref="P:System.Collections.Specialized.StringCollection.Count" />. </exception>
// Token: 0x170000AC RID: 172
object IList.this[int index]
{
get
{
return this[index];
}
set
{
this[index] = (string)value;
}
}
/// <summary>Adds an object to the end of the <see cref="T:System.Collections.Specialized.StringCollection" />.</summary>
/// <returns>The <see cref="T:System.Collections.Specialized.StringCollection" /> index at which the <paramref name="value" /> has been added.</returns>
/// <param name="value">The <see cref="T:System.Object" /> to be added to the end of the <see cref="T:System.Collections.Specialized.StringCollection" />. The value can be null. </param>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Specialized.StringCollection" /> is read-only.-or- The <see cref="T:System.Collections.Specialized.StringCollection" /> has a fixed size. </exception>
// Token: 0x0600026A RID: 618 RVA: 0x00008FA0 File Offset: 0x000071A0
int IList.Add(object value)
{
return this.Add((string)value);
}
/// <summary>Determines whether an element is in the <see cref="T:System.Collections.Specialized.StringCollection" />.</summary>
/// <returns>true if <paramref name="value" /> is found in the <see cref="T:System.Collections.Specialized.StringCollection" />; otherwise, false.</returns>
/// <param name="value">The <see cref="T:System.Object" /> to locate in the <see cref="T:System.Collections.Specialized.StringCollection" />. The value can be null. </param>
// Token: 0x0600026B RID: 619 RVA: 0x00008FB0 File Offset: 0x000071B0
bool IList.Contains(object value)
{
return this.Contains((string)value);
}
/// <summary>Searches for the specified <see cref="T:System.Object" /> and returns the zero-based index of the first occurrence within the entire <see cref="T:System.Collections.Specialized.StringCollection" />.</summary>
/// <returns>The zero-based index of the first occurrence of <paramref name="value" /> within the entire <see cref="T:System.Collections.Specialized.StringCollection" />, if found; otherwise, -1.</returns>
/// <param name="value">The <see cref="T:System.Object" /> to locate in the <see cref="T:System.Collections.Specialized.StringCollection" />. The value can be null. </param>
// Token: 0x0600026C RID: 620 RVA: 0x00008FC0 File Offset: 0x000071C0
int IList.IndexOf(object value)
{
return this.IndexOf((string)value);
}
/// <summary>Inserts an element into the <see cref="T:System.Collections.Specialized.StringCollection" /> at the specified index.</summary>
/// <param name="index">The zero-based index at which <paramref name="value" /> should be inserted. </param>
/// <param name="value">The <see cref="T:System.Object" /> to insert. The value can be null. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero.-or- <paramref name="index" /> is greater than <see cref="P:System.Collections.Specialized.StringCollection.Count" />. </exception>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Specialized.StringCollection" /> is read-only.-or- The <see cref="T:System.Collections.Specialized.StringCollection" /> has a fixed size. </exception>
// Token: 0x0600026D RID: 621 RVA: 0x00008FD0 File Offset: 0x000071D0
void IList.Insert(int index, object value)
{
this.Insert(index, (string)value);
}
/// <summary>Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Specialized.StringCollection" />.</summary>
/// <param name="value">The <see cref="T:System.Object" /> to remove from the <see cref="T:System.Collections.Specialized.StringCollection" />. The value can be null. </param>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Specialized.StringCollection" /> is read-only.-or- The <see cref="T:System.Collections.Specialized.StringCollection" /> has a fixed size. </exception>
// Token: 0x0600026E RID: 622 RVA: 0x00008FE0 File Offset: 0x000071E0
void IList.Remove(object value)
{
this.Remove((string)value);
}
/// <summary>Copies the entire <see cref="T:System.Collections.Specialized.StringCollection" /> to a compatible one-dimensional <see cref="T:System.Array" />, starting at the specified index of the target array.</summary>
/// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from <see cref="T:System.Collections.Specialized.StringCollection" />. The <see cref="T:System.Array" /> must have zero-based indexing. </param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or- The number of elements in the source <see cref="T:System.Collections.Specialized.StringCollection" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />. </exception>
/// <exception cref="T:System.InvalidCastException">The type of the source <see cref="T:System.Collections.Specialized.StringCollection" /> cannot be cast automatically to the type of the destination <paramref name="array" />. </exception>
// Token: 0x0600026F RID: 623 RVA: 0x00008FF0 File Offset: 0x000071F0
void ICollection.CopyTo(Array array, int index)
{
this.data.CopyTo(array, index);
}
/// <summary>Returns a <see cref="T:System.Collections.IEnumerator" /> that iterates through the <see cref="T:System.Collections.Specialized.StringCollection" />.</summary>
/// <returns>A <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:System.Collections.Specialized.StringCollection" />.</returns>
// Token: 0x06000270 RID: 624 RVA: 0x00009000 File Offset: 0x00007200
IEnumerator IEnumerable.GetEnumerator()
{
return this.data.GetEnumerator();
}
/// <summary>Gets or sets the element at the specified index.</summary>
/// <returns>The element at the specified index.</returns>
/// <param name="index">The zero-based index of the entry to get or set. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero.-or- <paramref name="index" /> is equal to or greater than <see cref="P:System.Collections.Specialized.StringCollection.Count" />. </exception>
// Token: 0x170000AD RID: 173
public string this[int index]
{
get
{
return (string)this.data[index];
}
set
{
this.data[index] = value;
}
}
/// <summary>Gets the number of strings contained in the <see cref="T:System.Collections.Specialized.StringCollection" />.</summary>
/// <returns>The number of strings contained in the <see cref="T:System.Collections.Specialized.StringCollection" />.</returns>
// Token: 0x170000AE RID: 174
// (get) Token: 0x06000273 RID: 627 RVA: 0x00009034 File Offset: 0x00007234
public int Count
{
get
{
return this.data.Count;
}
}
/// <summary>Adds a string to the end of the <see cref="T:System.Collections.Specialized.StringCollection" />.</summary>
/// <returns>The zero-based index at which the new element is inserted.</returns>
/// <param name="value">The string to add to the end of the <see cref="T:System.Collections.Specialized.StringCollection" />. The value can be null. </param>
// Token: 0x06000274 RID: 628 RVA: 0x00009044 File Offset: 0x00007244
public int Add(string value)
{
return this.data.Add(value);
}
/// <summary>Copies the elements of a string array to the end of the <see cref="T:System.Collections.Specialized.StringCollection" />.</summary>
/// <param name="value">An array of strings to add to the end of the <see cref="T:System.Collections.Specialized.StringCollection" />. The array itself can not be null but it can contain elements that are null. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="value" /> is null. </exception>
// Token: 0x06000275 RID: 629 RVA: 0x00009054 File Offset: 0x00007254
public void AddRange(string[] value)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
this.data.AddRange(value);
}
/// <summary>Removes all the strings from the <see cref="T:System.Collections.Specialized.StringCollection" />.</summary>
// Token: 0x06000276 RID: 630 RVA: 0x00009074 File Offset: 0x00007274
public void Clear()
{
this.data.Clear();
}
/// <summary>Determines whether the specified string is in the <see cref="T:System.Collections.Specialized.StringCollection" />.</summary>
/// <returns>true if <paramref name="value" /> is found in the <see cref="T:System.Collections.Specialized.StringCollection" />; otherwise, false.</returns>
/// <param name="value">The string to locate in the <see cref="T:System.Collections.Specialized.StringCollection" />. The value can be null. </param>
// Token: 0x06000277 RID: 631 RVA: 0x00009084 File Offset: 0x00007284
public bool Contains(string value)
{
return this.data.Contains(value);
}
/// <summary>Copies the entire <see cref="T:System.Collections.Specialized.StringCollection" /> values to a one-dimensional array of strings, starting at the specified index of the target array.</summary>
/// <param name="array">The one-dimensional array of strings that is the destination of the elements copied from <see cref="T:System.Collections.Specialized.StringCollection" />. The <see cref="T:System.Array" /> must have zero-based indexing. </param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or- The number of elements in the source <see cref="T:System.Collections.Specialized.StringCollection" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />. </exception>
/// <exception cref="T:System.InvalidCastException">The type of the source <see cref="T:System.Collections.Specialized.StringCollection" /> cannot be cast automatically to the type of the destination <paramref name="array" />. </exception>
// Token: 0x06000278 RID: 632 RVA: 0x00009094 File Offset: 0x00007294
public void CopyTo(string[] array, int index)
{
this.data.CopyTo(array, index);
}
/// <summary>Returns a <see cref="T:System.Collections.Specialized.StringEnumerator" /> that iterates through the <see cref="T:System.Collections.Specialized.StringCollection" />.</summary>
/// <returns>A <see cref="T:System.Collections.Specialized.StringEnumerator" /> for the <see cref="T:System.Collections.Specialized.StringCollection" />.</returns>
// Token: 0x06000279 RID: 633 RVA: 0x000090A4 File Offset: 0x000072A4
public StringEnumerator GetEnumerator()
{
return new StringEnumerator(this);
}
/// <summary>Searches for the specified string and returns the zero-based index of the first occurrence within the <see cref="T:System.Collections.Specialized.StringCollection" />.</summary>
/// <returns>The zero-based index of the first occurrence of <paramref name="value" /> in the <see cref="T:System.Collections.Specialized.StringCollection" />, if found; otherwise, -1.</returns>
/// <param name="value">The string to locate. The value can be null. </param>
// Token: 0x0600027A RID: 634 RVA: 0x000090AC File Offset: 0x000072AC
public int IndexOf(string value)
{
return this.data.IndexOf(value);
}
/// <summary>Inserts a string into the <see cref="T:System.Collections.Specialized.StringCollection" /> at the specified index.</summary>
/// <param name="index">The zero-based index at which <paramref name="value" /> is inserted. </param>
/// <param name="value">The string to insert. The value can be null. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero.-or- <paramref name="index" /> greater than <see cref="P:System.Collections.Specialized.StringCollection.Count" />. </exception>
// Token: 0x0600027B RID: 635 RVA: 0x000090BC File Offset: 0x000072BC
public void Insert(int index, string value)
{
this.data.Insert(index, value);
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.Specialized.StringCollection" /> is read-only.</summary>
/// <returns>This property always returns false.</returns>
// Token: 0x170000AF RID: 175
// (get) Token: 0x0600027C RID: 636 RVA: 0x000090CC File Offset: 0x000072CC
public bool IsReadOnly
{
get
{
return false;
}
}
/// <summary>Gets a value indicating whether access to the <see cref="T:System.Collections.Specialized.StringCollection" /> is synchronized (thread safe).</summary>
/// <returns>This property always returns false.</returns>
// Token: 0x170000B0 RID: 176
// (get) Token: 0x0600027D RID: 637 RVA: 0x000090D0 File Offset: 0x000072D0
public bool IsSynchronized
{
get
{
return false;
}
}
/// <summary>Removes the first occurrence of a specific string from the <see cref="T:System.Collections.Specialized.StringCollection" />.</summary>
/// <param name="value">The string to remove from the <see cref="T:System.Collections.Specialized.StringCollection" />. The value can be null. </param>
// Token: 0x0600027E RID: 638 RVA: 0x000090D4 File Offset: 0x000072D4
public void Remove(string value)
{
this.data.Remove(value);
}
/// <summary>Removes the string at the specified index of the <see cref="T:System.Collections.Specialized.StringCollection" />.</summary>
/// <param name="index">The zero-based index of the string to remove. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero.-or- <paramref name="index" /> is equal to or greater than <see cref="P:System.Collections.Specialized.StringCollection.Count" />. </exception>
// Token: 0x0600027F RID: 639 RVA: 0x000090E4 File Offset: 0x000072E4
public void RemoveAt(int index)
{
this.data.RemoveAt(index);
}
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.StringCollection" />.</summary>
/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.StringCollection" />.</returns>
// Token: 0x170000B1 RID: 177
// (get) Token: 0x06000280 RID: 640 RVA: 0x000090F4 File Offset: 0x000072F4
public object SyncRoot
{
get
{
return this;
}
}
// Token: 0x040000B2 RID: 178
private ArrayList data = new ArrayList();
}
}
@@ -0,0 +1,192 @@
using System;
using System.Globalization;
namespace System.Collections.Specialized
{
/// <summary>Implements a hash table with the key and the value strongly typed to be strings rather than objects.</summary>
// Token: 0x0200003A RID: 58
[Serializable]
public class StringDictionary : IEnumerable
{
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.StringDictionary" /> class.</summary>
// Token: 0x06000281 RID: 641 RVA: 0x000090F8 File Offset: 0x000072F8
public StringDictionary()
{
this.contents = new Hashtable();
}
/// <summary>Gets the number of key/value pairs in the <see cref="T:System.Collections.Specialized.StringDictionary" />.</summary>
/// <returns>The number of key/value pairs in the <see cref="T:System.Collections.Specialized.StringDictionary" />.Retrieving the value of this property is an O(1) operation.</returns>
// Token: 0x170000B2 RID: 178
// (get) Token: 0x06000282 RID: 642 RVA: 0x0000910C File Offset: 0x0000730C
public virtual int Count
{
get
{
return this.contents.Count;
}
}
/// <summary>Gets a value indicating whether access to the <see cref="T:System.Collections.Specialized.StringDictionary" /> is synchronized (thread safe).</summary>
/// <returns>true if access to the <see cref="T:System.Collections.Specialized.StringDictionary" /> is synchronized (thread safe); otherwise, false.</returns>
// Token: 0x170000B3 RID: 179
// (get) Token: 0x06000283 RID: 643 RVA: 0x0000911C File Offset: 0x0000731C
public virtual bool IsSynchronized
{
get
{
return false;
}
}
/// <summary>Gets or sets the value associated with the specified key.</summary>
/// <returns>The value associated with the specified key. If the specified key is not found, Get returns null, and Set creates a new entry with the specified key.</returns>
/// <param name="key">The key whose value to get or set. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x170000B4 RID: 180
public virtual string this[string key]
{
get
{
if (key == null)
{
throw new ArgumentNullException("key");
}
return (string)this.contents[key.ToLower(CultureInfo.InvariantCulture)];
}
set
{
if (key == null)
{
throw new ArgumentNullException("key");
}
this.contents[key.ToLower(CultureInfo.InvariantCulture)] = value;
}
}
/// <summary>Gets a collection of keys in the <see cref="T:System.Collections.Specialized.StringDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.ICollection" /> that provides the keys in the <see cref="T:System.Collections.Specialized.StringDictionary" />.</returns>
// Token: 0x170000B5 RID: 181
// (get) Token: 0x06000286 RID: 646 RVA: 0x00009194 File Offset: 0x00007394
public virtual ICollection Keys
{
get
{
return this.contents.Keys;
}
}
/// <summary>Gets a collection of values in the <see cref="T:System.Collections.Specialized.StringDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.ICollection" /> that provides the values in the <see cref="T:System.Collections.Specialized.StringDictionary" />.</returns>
// Token: 0x170000B6 RID: 182
// (get) Token: 0x06000287 RID: 647 RVA: 0x000091A4 File Offset: 0x000073A4
public virtual ICollection Values
{
get
{
return this.contents.Values;
}
}
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.StringDictionary" />.</summary>
/// <returns>An <see cref="T:System.Object" /> that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.StringDictionary" />.</returns>
// Token: 0x170000B7 RID: 183
// (get) Token: 0x06000288 RID: 648 RVA: 0x000091B4 File Offset: 0x000073B4
public virtual object SyncRoot
{
get
{
return this.contents.SyncRoot;
}
}
/// <summary>Adds an entry with the specified key and value into the <see cref="T:System.Collections.Specialized.StringDictionary" />.</summary>
/// <param name="key">The key of the entry to add. </param>
/// <param name="value">The value of the entry to add. The value can be null. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null. </exception>
/// <exception cref="T:System.ArgumentException">An entry with the same key already exists in the <see cref="T:System.Collections.Specialized.StringDictionary" />. </exception>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Specialized.StringDictionary" /> is read-only. </exception>
// Token: 0x06000289 RID: 649 RVA: 0x000091C4 File Offset: 0x000073C4
public virtual void Add(string key, string value)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
this.contents.Add(key.ToLower(CultureInfo.InvariantCulture), value);
}
/// <summary>Removes all entries from the <see cref="T:System.Collections.Specialized.StringDictionary" />.</summary>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Specialized.StringDictionary" /> is read-only. </exception>
// Token: 0x0600028A RID: 650 RVA: 0x000091FC File Offset: 0x000073FC
public virtual void Clear()
{
this.contents.Clear();
}
/// <summary>Determines if the <see cref="T:System.Collections.Specialized.StringDictionary" /> contains a specific key.</summary>
/// <returns>true if the <see cref="T:System.Collections.Specialized.StringDictionary" /> contains an entry with the specified key; otherwise, false.</returns>
/// <param name="key">The key to locate in the <see cref="T:System.Collections.Specialized.StringDictionary" />. </param>
/// <exception cref="T:System.ArgumentNullException">The key is null. </exception>
// Token: 0x0600028B RID: 651 RVA: 0x0000920C File Offset: 0x0000740C
public virtual bool ContainsKey(string key)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
return this.contents.ContainsKey(key.ToLower(CultureInfo.InvariantCulture));
}
/// <summary>Determines if the <see cref="T:System.Collections.Specialized.StringDictionary" /> contains a specific value.</summary>
/// <returns>true if the <see cref="T:System.Collections.Specialized.StringDictionary" /> contains an element with the specified value; otherwise, false.</returns>
/// <param name="value">The value to locate in the <see cref="T:System.Collections.Specialized.StringDictionary" />. The value can be null. </param>
// Token: 0x0600028C RID: 652 RVA: 0x00009238 File Offset: 0x00007438
public virtual bool ContainsValue(string value)
{
return this.contents.ContainsValue(value);
}
/// <summary>Copies the string dictionary values to a one-dimensional <see cref="T:System.Array" /> instance at the specified index.</summary>
/// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the values copied from the <see cref="T:System.Collections.Specialized.StringDictionary" />. </param>
/// <param name="index">The index in the array where copying begins. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or- The number of elements in the <see cref="T:System.Collections.Specialized.StringDictionary" /> is greater than the available space from <paramref name="index" /> to the end of <paramref name="array" />. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than the lower bound of <paramref name="array" />. </exception>
// Token: 0x0600028D RID: 653 RVA: 0x00009248 File Offset: 0x00007448
public virtual void CopyTo(Array array, int index)
{
this.contents.CopyTo(array, index);
}
/// <summary>Returns an enumerator that iterates through the string dictionary.</summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> that iterates through the string dictionary.</returns>
// Token: 0x0600028E RID: 654 RVA: 0x00009258 File Offset: 0x00007458
public virtual IEnumerator GetEnumerator()
{
return this.contents.GetEnumerator();
}
/// <summary>Removes the entry with the specified key from the string dictionary.</summary>
/// <param name="key">The key of the entry to remove. </param>
/// <exception cref="T:System.ArgumentNullException">The key is null. </exception>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Specialized.StringDictionary" /> is read-only. </exception>
// Token: 0x0600028F RID: 655 RVA: 0x00009268 File Offset: 0x00007468
public virtual void Remove(string key)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
this.contents.Remove(key.ToLower(CultureInfo.InvariantCulture));
}
// Token: 0x040000B3 RID: 179
private Hashtable contents;
}
}
@@ -0,0 +1,48 @@
using System;
namespace System.Collections.Specialized
{
/// <summary>Supports a simple iteration over a <see cref="T:System.Collections.Specialized.StringCollection" />.</summary>
// Token: 0x0200003B RID: 59
public class StringEnumerator
{
// Token: 0x06000290 RID: 656 RVA: 0x00009294 File Offset: 0x00007494
internal StringEnumerator(StringCollection coll)
{
this.enumerable = ((IEnumerable)coll).GetEnumerator();
}
/// <summary>Gets the current element in the collection.</summary>
/// <returns>The current element in the collection.</returns>
/// <exception cref="T:System.InvalidOperationException">The enumerator is positioned before the first element of the collection or after the last element. </exception>
// Token: 0x170000B8 RID: 184
// (get) Token: 0x06000291 RID: 657 RVA: 0x000092A8 File Offset: 0x000074A8
public string Current
{
get
{
return (string)this.enumerable.Current;
}
}
/// <summary>Advances the enumerator to the next element of the collection.</summary>
/// <returns>true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.</returns>
/// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
// Token: 0x06000292 RID: 658 RVA: 0x000092BC File Offset: 0x000074BC
public bool MoveNext()
{
return this.enumerable.MoveNext();
}
/// <summary>Sets the enumerator to its initial position, which is before the first element in the collection.</summary>
/// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
// Token: 0x06000293 RID: 659 RVA: 0x000092CC File Offset: 0x000074CC
public void Reset()
{
this.enumerable.Reset();
}
// Token: 0x040000B4 RID: 180
private IEnumerator enumerable;
}
}