using System;
namespace System.Collections.Generic
{
/// Represents a collection of key/value pairs that are sorted on the key.
/// The type of the keys in the dictionary.
/// The type of the values in the dictionary.
/// 1
// Token: 0x02000014 RID: 20
[Serializable]
public class SortedDictionary : ICollection, IEnumerable>, IDictionary, IEnumerable, IDictionary, ICollection>
{
/// Initializes a new instance of the class that is empty and uses the default implementation for the key type.
// Token: 0x06000083 RID: 131 RVA: 0x00004094 File Offset: 0x00002294
public SortedDictionary()
: this(null)
{
}
/// Initializes a new instance of the class that is empty and uses the specified implementation to compare keys.
/// The implementation to use when comparing keys, or null to use the default for the type of the key.
// Token: 0x06000084 RID: 132 RVA: 0x000040A0 File Offset: 0x000022A0
public SortedDictionary(IComparer comparer)
{
this.hlp = SortedDictionary.NodeHelper.GetHelper(comparer);
this.tree = new RBTree(this.hlp);
}
/// Initializes a new instance of the class that contains elements copied from the specified and uses the default implementation for the key type.
/// The whose elements are copied to the new .
///
/// is null.
///
/// contains one or more duplicate keys.
// Token: 0x06000085 RID: 133 RVA: 0x000040C8 File Offset: 0x000022C8
public SortedDictionary(IDictionary dic)
: this(dic, null)
{
}
/// Initializes a new instance of the class that contains elements copied from the specified and uses the specified implementation to compare keys.
/// The whose elements are copied to the new .
/// The implementation to use when comparing keys, or null to use the default for the type of the key.
///
/// is null.
///
/// contains one or more duplicate keys.
// Token: 0x06000086 RID: 134 RVA: 0x000040D4 File Offset: 0x000022D4
public SortedDictionary(IDictionary dic, IComparer comparer)
: this(comparer)
{
if (dic == null)
{
throw new ArgumentNullException();
}
foreach (KeyValuePair keyValuePair in dic)
{
this.Add(keyValuePair.Key, keyValuePair.Value);
}
}
// Token: 0x1700001B RID: 27
// (get) Token: 0x06000087 RID: 135 RVA: 0x00004154 File Offset: 0x00002354
ICollection IDictionary.Keys
{
get
{
return new SortedDictionary.KeyCollection(this);
}
}
// Token: 0x1700001C RID: 28
// (get) Token: 0x06000088 RID: 136 RVA: 0x0000415C File Offset: 0x0000235C
ICollection IDictionary.Values
{
get
{
return new SortedDictionary.ValueCollection(this);
}
}
// Token: 0x06000089 RID: 137 RVA: 0x00004164 File Offset: 0x00002364
void ICollection>.Add(KeyValuePair item)
{
this.Add(item.Key, item.Value);
}
// Token: 0x0600008A RID: 138 RVA: 0x0000417C File Offset: 0x0000237C
bool ICollection>.Contains(KeyValuePair item)
{
TValue tvalue;
return this.TryGetValue(item.Key, out tvalue) && EqualityComparer.Default.Equals(item.Value, tvalue);
}
// Token: 0x1700001D RID: 29
// (get) Token: 0x0600008B RID: 139 RVA: 0x000041B4 File Offset: 0x000023B4
bool ICollection>.IsReadOnly
{
get
{
return false;
}
}
// Token: 0x0600008C RID: 140 RVA: 0x000041B8 File Offset: 0x000023B8
bool ICollection>.Remove(KeyValuePair item)
{
TValue tvalue;
return this.TryGetValue(item.Key, out tvalue) && EqualityComparer.Default.Equals(item.Value, tvalue) && this.Remove(item.Key);
}
/// Adds an element with the provided key and value to the .
/// The object to use as the key of the element to add.
/// The object to use as the value of the element to add.
///
/// is null.
///
/// is of a type that is not assignable to the key type of the .-or- is of a type that is not assignable to the value type of the .-or-An element with the same key already exists in the .
// Token: 0x0600008D RID: 141 RVA: 0x00004200 File Offset: 0x00002400
void IDictionary.Add(object key, object value)
{
this.Add(this.ToKey(key), this.ToValue(value));
}
/// Determines whether the contains an element with the specified key.
/// true if the contains an element with the key; otherwise, false.
/// The key to locate in the .
///
/// is null.
// Token: 0x0600008E RID: 142 RVA: 0x00004218 File Offset: 0x00002418
bool IDictionary.Contains(object key)
{
return this.ContainsKey(this.ToKey(key));
}
/// Returns an for the .
/// An for the .
// Token: 0x0600008F RID: 143 RVA: 0x00004228 File Offset: 0x00002428
IDictionaryEnumerator IDictionary.GetEnumerator()
{
return new SortedDictionary.Enumerator(this);
}
/// Gets a value indicating whether the has a fixed size.
/// true if the has a fixed size; otherwise, false. In the default implementation of , this property always returns false.
// Token: 0x1700001E RID: 30
// (get) Token: 0x06000090 RID: 144 RVA: 0x00004238 File Offset: 0x00002438
bool IDictionary.IsFixedSize
{
get
{
return false;
}
}
/// Gets a value indicating whether the is read-only.
/// true if the is read-only; otherwise, false. In the default implementation of , this property always returns false.
// Token: 0x1700001F RID: 31
// (get) Token: 0x06000091 RID: 145 RVA: 0x0000423C File Offset: 0x0000243C
bool IDictionary.IsReadOnly
{
get
{
return false;
}
}
/// Gets an containing the keys of the .
/// An containing the keys of the .
// Token: 0x17000020 RID: 32
// (get) Token: 0x06000092 RID: 146 RVA: 0x00004240 File Offset: 0x00002440
ICollection IDictionary.Keys
{
get
{
return new SortedDictionary.KeyCollection(this);
}
}
/// Removes the element with the specified key from the .
/// The key of the element to remove.
///
/// is null.
// Token: 0x06000093 RID: 147 RVA: 0x00004248 File Offset: 0x00002448
void IDictionary.Remove(object key)
{
this.Remove(this.ToKey(key));
}
/// Gets an containing the values in the .
/// An containing the values in the .
// Token: 0x17000021 RID: 33
// (get) Token: 0x06000094 RID: 148 RVA: 0x00004258 File Offset: 0x00002458
ICollection IDictionary.Values
{
get
{
return new SortedDictionary.ValueCollection(this);
}
}
/// Gets or sets the element with the specified key.
/// The element with the specified key, or null if is not in the dictionary or is of a type that is not assignable to the key type of the .
/// The key of the element to get.
///
/// is null.
/// A value is being assigned, and is of a type that is not assignable to the key type of the .-or-A value is being assigned, and is of a type that is not assignable to the value type of the .
// Token: 0x17000022 RID: 34
object IDictionary.this[object key]
{
get
{
return this[this.ToKey(key)];
}
set
{
this[this.ToKey(key)] = this.ToValue(value);
}
}
/// Copies the elements of the to an array, starting at the specified array index.
/// The one-dimensional array that is the destination of the elements copied from the . The array must have zero-based indexing.
/// The zero-based index in at which copying begins.
///
/// is null.
///
/// is less than 0.
///
/// is multidimensional.-or- does not have zero-based indexing.-or-The number of elements in the source is greater than the available space from to the end of the destination .-or-The type of the source cannot be cast automatically to the type of the destination .
// 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.Node node2 = (SortedDictionary.Node)node;
array.SetValue(node2.AsDE(), index++);
}
}
/// Gets a value indicating whether access to the is synchronized (thread safe).
/// true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false.
// Token: 0x17000023 RID: 35
// (get) Token: 0x06000098 RID: 152 RVA: 0x00004354 File Offset: 0x00002554
bool ICollection.IsSynchronized
{
get
{
return false;
}
}
/// Gets an object that can be used to synchronize access to the .
/// An object that can be used to synchronize access to the .
// Token: 0x17000024 RID: 36
// (get) Token: 0x06000099 RID: 153 RVA: 0x00004358 File Offset: 0x00002558
object ICollection.SyncRoot
{
get
{
return this;
}
}
/// Returns an enumerator that iterates through the collection.
/// An that can be used to iterate through the collection.
// Token: 0x0600009A RID: 154 RVA: 0x0000435C File Offset: 0x0000255C
IEnumerator IEnumerable.GetEnumerator()
{
return new SortedDictionary.Enumerator(this);
}
// Token: 0x0600009B RID: 155 RVA: 0x0000436C File Offset: 0x0000256C
IEnumerator> IEnumerable>.GetEnumerator()
{
return new SortedDictionary.Enumerator(this);
}
/// Gets the used to order the elements of the .
/// The used to order the elements of the
// Token: 0x17000025 RID: 37
// (get) Token: 0x0600009C RID: 156 RVA: 0x0000437C File Offset: 0x0000257C
public IComparer Comparer
{
get
{
return this.hlp.cmp;
}
}
/// Gets the number of key/value pairs contained in the .
/// The number of key/value pairs contained in the .
// Token: 0x17000026 RID: 38
// (get) Token: 0x0600009D RID: 157 RVA: 0x0000438C File Offset: 0x0000258C
public int Count
{
get
{
return this.tree.Count;
}
}
/// Gets or sets the value associated with the specified key.
/// The value associated with the specified key. If the specified key is not found, a get operation throws a , and a set operation creates a new element with the specified key.
/// The key of the value to get or set.
///
/// is null.
/// The property is retrieved and does not exist in the collection.
// Token: 0x17000027 RID: 39
public TValue this[TKey key]
{
get
{
SortedDictionary.Node node = (SortedDictionary.Node)this.tree.Lookup(key);
if (node == null)
{
throw new KeyNotFoundException();
}
return node.value;
}
set
{
if (key == null)
{
throw new ArgumentNullException("key");
}
SortedDictionary.Node node = (SortedDictionary.Node)this.tree.Intern(key, null);
node.value = value;
}
}
/// Gets a collection containing the keys in the .
/// A containing the keys in the .
// Token: 0x17000028 RID: 40
// (get) Token: 0x060000A0 RID: 160 RVA: 0x00004410 File Offset: 0x00002610
public SortedDictionary.KeyCollection Keys
{
get
{
return new SortedDictionary.KeyCollection(this);
}
}
/// Gets a collection containing the values in the .
/// A containing the values in the .
// Token: 0x17000029 RID: 41
// (get) Token: 0x060000A1 RID: 161 RVA: 0x00004418 File Offset: 0x00002618
public SortedDictionary.ValueCollection Values
{
get
{
return new SortedDictionary.ValueCollection(this);
}
}
/// Adds an element with the specified key and value into the .
/// The key of the element to add.
/// The value of the element to add. The value can be null for reference types.
///
/// is null.
/// An element with the same key already exists in the .
// 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.Node(key, value);
if (this.tree.Intern(key, node) != node)
{
throw new ArgumentException("key already present in dictionary", "key");
}
}
/// Removes all elements from the .
// Token: 0x060000A3 RID: 163 RVA: 0x00004470 File Offset: 0x00002670
public void Clear()
{
this.tree.Clear();
}
/// Determines whether the contains an element with the specified key.
/// true if the contains an element with the specified key; otherwise, false.
/// The key to locate in the .
///
/// is null.
// Token: 0x060000A4 RID: 164 RVA: 0x00004480 File Offset: 0x00002680
public bool ContainsKey(TKey key)
{
return this.tree.Lookup(key) != null;
}
/// Determines whether the contains an element with the specified value.
/// true if the contains an element with the specified value; otherwise, false.
/// The value to locate in the . The value can be null for reference types.
// Token: 0x060000A5 RID: 165 RVA: 0x00004494 File Offset: 0x00002694
public bool ContainsValue(TValue value)
{
IEqualityComparer @default = EqualityComparer.Default;
foreach (RBTree.Node node in this.tree)
{
SortedDictionary.Node node2 = (SortedDictionary.Node)node;
if (@default.Equals(value, node2.value))
{
return true;
}
}
return false;
}
/// Copies the elements of the to the specified array of structures, starting at the specified index.
/// The one-dimensional array of structures that is the destination of the elements copied from the current The array must have zero-based indexing.
/// The zero-based index in at which copying begins.
///
/// is null.
///
/// is less than 0.
/// The number of elements in the source is greater than the available space from to the end of the destination .
// Token: 0x060000A6 RID: 166 RVA: 0x0000451C File Offset: 0x0000271C
public void CopyTo(KeyValuePair[] 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.Node node2 = (SortedDictionary.Node)node;
array[arrayIndex++] = node2.AsKV();
}
}
/// Returns an enumerator that iterates through the .
/// A for the .
// Token: 0x060000A7 RID: 167 RVA: 0x000045DC File Offset: 0x000027DC
public SortedDictionary.Enumerator GetEnumerator()
{
return new SortedDictionary.Enumerator(this);
}
/// Removes the element with the specified key from the .
/// true if the element is successfully removed; otherwise, false. This method also returns false if is not found in the .
/// The key of the element to remove.
///
/// is null.
// Token: 0x060000A8 RID: 168 RVA: 0x000045E4 File Offset: 0x000027E4
public bool Remove(TKey key)
{
return this.tree.Remove(key) != null;
}
/// Gets the value associated with the specified key.
/// true if the contains an element with the specified key; otherwise, false.
/// The key of the value to get.
/// 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 parameter.
///
/// is null.
// Token: 0x060000A9 RID: 169 RVA: 0x000045F8 File Offset: 0x000027F8
public bool TryGetValue(TKey key, out TValue value)
{
SortedDictionary.Node node = (SortedDictionary.Node)this.tree.Lookup(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.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.Node node = (SortedDictionary.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 AsKV()
{
return new KeyValuePair(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
{
// Token: 0x060000B1 RID: 177 RVA: 0x00004778 File Offset: 0x00002978
private NodeHelper(IComparer 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.Node)node).key);
}
// Token: 0x060000B4 RID: 180 RVA: 0x000047B8 File Offset: 0x000029B8
public RBTree.Node CreateNode(TKey key)
{
return new SortedDictionary.Node(key);
}
// Token: 0x060000B5 RID: 181 RVA: 0x000047C0 File Offset: 0x000029C0
public static SortedDictionary.NodeHelper GetHelper(IComparer cmp)
{
if (cmp == null || cmp == Comparer.Default)
{
return SortedDictionary.NodeHelper.Default;
}
return new SortedDictionary.NodeHelper(cmp);
}
// Token: 0x0400004D RID: 77
public IComparer cmp;
// Token: 0x0400004E RID: 78
private static SortedDictionary.NodeHelper Default = new SortedDictionary.NodeHelper(Comparer.Default);
}
/// Represents the collection of values in a . This class cannot be inherited.
// Token: 0x02000017 RID: 23
[Serializable]
public sealed class ValueCollection : ICollection, IEnumerable, ICollection, IEnumerable
{
/// Initializes a new instance of the class that reflects the values in the specified .
/// The whose values are reflected in the new .
///
/// is null.
// Token: 0x060000B6 RID: 182 RVA: 0x000047E0 File Offset: 0x000029E0
public ValueCollection(SortedDictionary dic)
{
this._dic = dic;
}
// Token: 0x060000B7 RID: 183 RVA: 0x000047F0 File Offset: 0x000029F0
void ICollection.Add(TValue item)
{
throw new NotSupportedException();
}
// Token: 0x060000B8 RID: 184 RVA: 0x000047F8 File Offset: 0x000029F8
void ICollection.Clear()
{
throw new NotSupportedException();
}
// Token: 0x060000B9 RID: 185 RVA: 0x00004800 File Offset: 0x00002A00
bool ICollection.Contains(TValue item)
{
return this._dic.ContainsValue(item);
}
// Token: 0x1700002A RID: 42
// (get) Token: 0x060000BA RID: 186 RVA: 0x00004810 File Offset: 0x00002A10
bool ICollection.IsReadOnly
{
get
{
return true;
}
}
// Token: 0x060000BB RID: 187 RVA: 0x00004814 File Offset: 0x00002A14
bool ICollection.Remove(TValue item)
{
throw new NotSupportedException();
}
// Token: 0x060000BC RID: 188 RVA: 0x0000481C File Offset: 0x00002A1C
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
/// Copies the elements of the to an array, starting at a particular array index.
/// The one-dimensional array that is the destination of the elements copied from the . The array must have zero-based indexing.
/// The zero-based index in at which copying begins.
///
/// is null.
///
/// is less than 0.
///
/// is multidimensional.-or- does not have zero-based indexing.-or-The number of elements in the source is greater than the available space from to the end of the destination .-or-The type of the source cannot be cast automatically to the type of the destination .
// 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.Node node2 = (SortedDictionary.Node)node;
array.SetValue(node2.value, index++);
}
}
/// Gets a value indicating whether access to the is synchronized (thread safe).
/// true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false.
// Token: 0x1700002B RID: 43
// (get) Token: 0x060000BE RID: 190 RVA: 0x000048F8 File Offset: 0x00002AF8
bool ICollection.IsSynchronized
{
get
{
return false;
}
}
/// Gets an object that can be used to synchronize access to the .
/// An object that can be used to synchronize access to the . In the default implementation of , this property always returns the current instance.
// Token: 0x1700002C RID: 44
// (get) Token: 0x060000BF RID: 191 RVA: 0x000048FC File Offset: 0x00002AFC
object ICollection.SyncRoot
{
get
{
return this._dic;
}
}
/// Returns an enumerator that iterates through the collection.
/// An that can be used to iterate through the collection.
// Token: 0x060000C0 RID: 192 RVA: 0x00004904 File Offset: 0x00002B04
IEnumerator IEnumerable.GetEnumerator()
{
return new SortedDictionary.ValueCollection.Enumerator(this._dic);
}
/// Copies the elements to an existing one-dimensional array, starting at the specified array index.
/// The one-dimensional array that is the destination of the elements copied from the . The array must have zero-based indexing.
/// The zero-based index in at which copying begins.
///
/// is null.
///
/// is less than 0.
/// The number of elements in the source is greater than the available space from to the end of the destination .
// 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.Node node2 = (SortedDictionary.Node)node;
array[arrayIndex++] = node2.value;
}
}
/// Gets the number of elements contained in the .
/// The number of elements contained in the .
// Token: 0x1700002D RID: 45
// (get) Token: 0x060000C2 RID: 194 RVA: 0x000049D8 File Offset: 0x00002BD8
public int Count
{
get
{
return this._dic.Count;
}
}
/// Returns an enumerator that iterates through the .
/// A structure for the .
// Token: 0x060000C3 RID: 195 RVA: 0x000049E8 File Offset: 0x00002BE8
public SortedDictionary.ValueCollection.Enumerator GetEnumerator()
{
return new SortedDictionary.ValueCollection.Enumerator(this._dic);
}
// Token: 0x0400004F RID: 79
private SortedDictionary _dic;
/// Enumerates the elements of a .
// Token: 0x02000018 RID: 24
public struct Enumerator : IEnumerator, IDisposable, IEnumerator
{
// Token: 0x060000C4 RID: 196 RVA: 0x000049F8 File Offset: 0x00002BF8
internal Enumerator(SortedDictionary dic)
{
this.host = dic.tree.GetEnumerator();
}
/// Gets the element at the current position of the enumerator.
/// The element in the collection at the current position of the enumerator.
/// The enumerator is positioned before the first element of the collection or after the last element.
// 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;
}
}
/// Sets the enumerator to its initial position, which is before the first element in the collection.
/// The collection was modified after the enumerator was created.
// Token: 0x060000C6 RID: 198 RVA: 0x00004A24 File Offset: 0x00002C24
void IEnumerator.Reset()
{
this.host.Reset();
}
/// Gets the element at the current position of the enumerator.
/// The element in the at the current position of the enumerator.
// Token: 0x1700002F RID: 47
// (get) Token: 0x060000C7 RID: 199 RVA: 0x00004A34 File Offset: 0x00002C34
public TValue Current
{
get
{
return this.current;
}
}
/// Advances the enumerator to the next element of the .
/// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
/// The collection was modified after the enumerator was created.
// Token: 0x060000C8 RID: 200 RVA: 0x00004A3C File Offset: 0x00002C3C
public bool MoveNext()
{
if (!this.host.MoveNext())
{
return false;
}
this.current = ((SortedDictionary.Node)this.host.Current).value;
return true;
}
/// Releases all resources used by the .
// 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;
}
}
/// Represents the collection of keys in a . This class cannot be inherited.
// Token: 0x02000019 RID: 25
[Serializable]
public sealed class KeyCollection : ICollection, IEnumerable, ICollection, IEnumerable
{
/// Initializes a new instance of the class that reflects the keys in the specified .
/// The whose keys are reflected in the new .
///
/// is null.
// Token: 0x060000CA RID: 202 RVA: 0x00004A88 File Offset: 0x00002C88
public KeyCollection(SortedDictionary dic)
{
this._dic = dic;
}
// Token: 0x060000CB RID: 203 RVA: 0x00004A98 File Offset: 0x00002C98
void ICollection.Add(TKey item)
{
throw new NotSupportedException();
}
// Token: 0x060000CC RID: 204 RVA: 0x00004AA0 File Offset: 0x00002CA0
void ICollection.Clear()
{
throw new NotSupportedException();
}
// Token: 0x060000CD RID: 205 RVA: 0x00004AA8 File Offset: 0x00002CA8
bool ICollection.Contains(TKey item)
{
return this._dic.ContainsKey(item);
}
// Token: 0x060000CE RID: 206 RVA: 0x00004AB8 File Offset: 0x00002CB8
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
// Token: 0x17000030 RID: 48
// (get) Token: 0x060000CF RID: 207 RVA: 0x00004AC8 File Offset: 0x00002CC8
bool ICollection.IsReadOnly
{
get
{
return true;
}
}
// Token: 0x060000D0 RID: 208 RVA: 0x00004ACC File Offset: 0x00002CCC
bool ICollection.Remove(TKey item)
{
throw new NotSupportedException();
}
/// Copies the elements of the to an array, starting at a particular array index.
/// The one-dimensional array that is the destination of the elements copied from the . The array must have zero-based indexing.
/// The zero-based index in at which copying begins.
///
/// is null.
///
/// is less than 0.
///
/// is multidimensional.-or- does not have zero-based indexing.-or-The number of elements in the source is greater than the available space from to the end of the destination .-or-The type of the source cannot be cast automatically to the type of the destination .
// 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.Node node2 = (SortedDictionary.Node)node;
array.SetValue(node2.key, index++);
}
}
/// Gets a value indicating whether access to the is synchronized (thread safe).
/// true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false.
// Token: 0x17000031 RID: 49
// (get) Token: 0x060000D2 RID: 210 RVA: 0x00004BA0 File Offset: 0x00002DA0
bool ICollection.IsSynchronized
{
get
{
return false;
}
}
/// Gets an object that can be used to synchronize access to the .
/// An object that can be used to synchronize access to the . In the default implementation of , this property always returns the current instance.
// Token: 0x17000032 RID: 50
// (get) Token: 0x060000D3 RID: 211 RVA: 0x00004BA4 File Offset: 0x00002DA4
object ICollection.SyncRoot
{
get
{
return this._dic;
}
}
/// Returns an enumerator that iterates through the collection.
/// An that can be used to iterate through the collection.
// Token: 0x060000D4 RID: 212 RVA: 0x00004BAC File Offset: 0x00002DAC
IEnumerator IEnumerable.GetEnumerator()
{
return new SortedDictionary.KeyCollection.Enumerator(this._dic);
}
/// Copies the elements to an existing one-dimensional array, starting at the specified array index.
/// The one-dimensional array that is the destination of the elements copied from the . The array must have zero-based indexing.
/// The zero-based index in at which copying begins.
///
/// is null.
///
/// is less than 0.
/// The number of elements in the source is greater than the available space from to the end of the destination .
// 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.Node node2 = (SortedDictionary.Node)node;
array[arrayIndex++] = node2.key;
}
}
/// Gets the number of elements contained in the .
/// The number of elements contained in the .
// Token: 0x17000033 RID: 51
// (get) Token: 0x060000D6 RID: 214 RVA: 0x00004C80 File Offset: 0x00002E80
public int Count
{
get
{
return this._dic.Count;
}
}
/// Returns an enumerator that iterates through the .
/// A structure for the .
// Token: 0x060000D7 RID: 215 RVA: 0x00004C90 File Offset: 0x00002E90
public SortedDictionary.KeyCollection.Enumerator GetEnumerator()
{
return new SortedDictionary.KeyCollection.Enumerator(this._dic);
}
// Token: 0x04000052 RID: 82
private SortedDictionary _dic;
/// Enumerates the elements of a .
// Token: 0x0200001A RID: 26
public struct Enumerator : IEnumerator, IDisposable, IEnumerator
{
// Token: 0x060000D8 RID: 216 RVA: 0x00004CA0 File Offset: 0x00002EA0
internal Enumerator(SortedDictionary dic)
{
this.host = dic.tree.GetEnumerator();
}
/// Gets the element at the current position of the enumerator.
/// The element in the collection at the current position of the enumerator.
/// The enumerator is positioned before the first element of the collection or after the last element.
// 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;
}
}
/// Sets the enumerator to its initial position, which is before the first element in the collection.
/// The collection was modified after the enumerator was created.
// Token: 0x060000DA RID: 218 RVA: 0x00004CCC File Offset: 0x00002ECC
void IEnumerator.Reset()
{
this.host.Reset();
}
/// Gets the element at the current position of the enumerator.
/// The element in the at the current position of the enumerator.
// Token: 0x17000035 RID: 53
// (get) Token: 0x060000DB RID: 219 RVA: 0x00004CDC File Offset: 0x00002EDC
public TKey Current
{
get
{
return this.current;
}
}
/// Advances the enumerator to the next element of the .
/// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
/// The collection was modified after the enumerator was created.
// Token: 0x060000DC RID: 220 RVA: 0x00004CE4 File Offset: 0x00002EE4
public bool MoveNext()
{
if (!this.host.MoveNext())
{
return false;
}
this.current = ((SortedDictionary.Node)this.host.Current).key;
return true;
}
/// Releases all resources used by the .
// 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;
}
}
/// Enumerates the elements of a .
// Token: 0x0200001B RID: 27
public struct Enumerator : IEnumerator, IDisposable, IEnumerator>, IDictionaryEnumerator
{
// Token: 0x060000DE RID: 222 RVA: 0x00004D30 File Offset: 0x00002F30
internal Enumerator(SortedDictionary dic)
{
this.host = dic.tree.GetEnumerator();
}
/// Gets the element at the current position of the enumerator as a structure.
/// The element in the collection at the current position of the dictionary, as a structure.
/// The enumerator is positioned before the first element of the collection or after the last element.
// Token: 0x17000036 RID: 54
// (get) Token: 0x060000DF RID: 223 RVA: 0x00004D44 File Offset: 0x00002F44
DictionaryEntry IDictionaryEnumerator.Entry
{
get
{
return this.CurrentNode.AsDE();
}
}
/// Gets the key of the element at the current position of the enumerator.
/// The key of the element in the collection at the current position of the enumerator.
/// The enumerator is positioned before the first element of the collection or after the last element.
// Token: 0x17000037 RID: 55
// (get) Token: 0x060000E0 RID: 224 RVA: 0x00004D54 File Offset: 0x00002F54
object IDictionaryEnumerator.Key
{
get
{
return this.CurrentNode.key;
}
}
/// Gets the value of the element at the current position of the enumerator.
/// The value of the element in the collection at the current position of the enumerator.
/// The enumerator is positioned before the first element of the collection or after the last element.
// Token: 0x17000038 RID: 56
// (get) Token: 0x060000E1 RID: 225 RVA: 0x00004D68 File Offset: 0x00002F68
object IDictionaryEnumerator.Value
{
get
{
return this.CurrentNode.value;
}
}
/// Gets the element at the current position of the enumerator.
/// The element in the collection at the current position of the enumerator.
/// The enumerator is positioned before the first element of the collection or after the last element.
// Token: 0x17000039 RID: 57
// (get) Token: 0x060000E2 RID: 226 RVA: 0x00004D7C File Offset: 0x00002F7C
object IEnumerator.Current
{
get
{
return this.CurrentNode.AsDE();
}
}
/// Sets the enumerator to its initial position, which is before the first element in the collection.
/// The collection was modified after the enumerator was created.
// Token: 0x060000E3 RID: 227 RVA: 0x00004D90 File Offset: 0x00002F90
void IEnumerator.Reset()
{
this.host.Reset();
}
/// Gets the element at the current position of the enumerator.
/// The element in the at the current position of the enumerator.
// Token: 0x1700003A RID: 58
// (get) Token: 0x060000E4 RID: 228 RVA: 0x00004DA0 File Offset: 0x00002FA0
public KeyValuePair Current
{
get
{
return this.current;
}
}
/// Advances the enumerator to the next element of the .
/// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
/// The collection was modified after the enumerator was created.
// Token: 0x060000E5 RID: 229 RVA: 0x00004DA8 File Offset: 0x00002FA8
public bool MoveNext()
{
if (!this.host.MoveNext())
{
return false;
}
this.current = ((SortedDictionary.Node)this.host.Current).AsKV();
return true;
}
/// Releases all resources used by the .
// 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.Node CurrentNode
{
get
{
this.host.check_current();
return (SortedDictionary.Node)this.host.Current;
}
}
// Token: 0x04000055 RID: 85
private RBTree.NodeEnumerator host;
// Token: 0x04000056 RID: 86
private KeyValuePair current;
}
}
}