scripts
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
// Token: 0x020000FA RID: 250
|
||||
internal sealed class CollectionDebuggerView<T, U>
|
||||
{
|
||||
// Token: 0x06000C64 RID: 3172 RVA: 0x0003842C File Offset: 0x0003662C
|
||||
public CollectionDebuggerView(ICollection<KeyValuePair<T, U>> col)
|
||||
{
|
||||
this.c = col;
|
||||
}
|
||||
|
||||
// Token: 0x170001C6 RID: 454
|
||||
// (get) Token: 0x06000C65 RID: 3173 RVA: 0x0003843C File Offset: 0x0003663C
|
||||
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
|
||||
public KeyValuePair<T, U>[] Items
|
||||
{
|
||||
get
|
||||
{
|
||||
KeyValuePair<T, U>[] array = new KeyValuePair<T, U>[this.c.Count];
|
||||
this.c.CopyTo(array, 0);
|
||||
return array;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400035E RID: 862
|
||||
private readonly ICollection<KeyValuePair<T, U>> c;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
// Token: 0x020000F9 RID: 249
|
||||
internal sealed class CollectionDebuggerView<T>
|
||||
{
|
||||
// Token: 0x06000C62 RID: 3170 RVA: 0x000383F0 File Offset: 0x000365F0
|
||||
public CollectionDebuggerView(ICollection<T> col)
|
||||
{
|
||||
this.c = col;
|
||||
}
|
||||
|
||||
// Token: 0x170001C5 RID: 453
|
||||
// (get) Token: 0x06000C63 RID: 3171 RVA: 0x00038400 File Offset: 0x00036600
|
||||
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
|
||||
public T[] Items
|
||||
{
|
||||
get
|
||||
{
|
||||
T[] array = new T[this.c.Count];
|
||||
this.c.CopyTo(array, 0);
|
||||
return array;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400035D RID: 861
|
||||
private readonly ICollection<T> c;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
/// <summary>Provides a base class for implementations of the <see cref="T:System.Collections.Generic.IComparer`1" /> generic interface.</summary>
|
||||
/// <typeparam name="T">The type of objects to compare.</typeparam>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x020000FB RID: 251
|
||||
[Serializable]
|
||||
public abstract class Comparer<T> : IComparer<T>, IComparer
|
||||
{
|
||||
// Token: 0x06000C67 RID: 3175 RVA: 0x00038470 File Offset: 0x00036670
|
||||
static Comparer()
|
||||
{
|
||||
if (typeof(IComparable<T>).IsAssignableFrom(typeof(T)))
|
||||
{
|
||||
Comparer<T>._default = (Comparer<T>)Activator.CreateInstance(typeof(GenericComparer<>).MakeGenericType(new Type[] { typeof(T) }));
|
||||
}
|
||||
else
|
||||
{
|
||||
Comparer<T>._default = new Comparer<T>.DefaultComparer();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.</summary>
|
||||
/// <returns>A signed integer that indicates the relative values of <paramref name="x" /> and <paramref name="y" />, as shown in the following table.Value Meaning Less than zero<paramref name="x" /> is less than <paramref name="y" />.Zero<paramref name="x" /> equals <paramref name="y" />.Greater than zero<paramref name="x" /> is greater than <paramref name="y" />.</returns>
|
||||
/// <param name="x">The first object to compare.</param>
|
||||
/// <param name="y">The second object to compare.</param>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="x" /> or <paramref name="y" /> is of a type that cannot be cast to type <paramref name="T" />.-or-<paramref name="x" /> and <paramref name="y" /> do not implement either the <see cref="T:System.IComparable`1" /> generic interface or the <see cref="T:System.IComparable" /> interface.</exception>
|
||||
// Token: 0x06000C68 RID: 3176 RVA: 0x000384DC File Offset: 0x000366DC
|
||||
int IComparer.Compare(object x, object y)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
return (y != null) ? (-1) : 0;
|
||||
}
|
||||
if (y == null)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if (x is T && y is T)
|
||||
{
|
||||
return this.Compare((T)((object)x), (T)((object)y));
|
||||
}
|
||||
throw new ArgumentException();
|
||||
}
|
||||
|
||||
/// <summary>When overridden in a derived class, performs a comparison of two objects of the same type and returns a value indicating whether one object is less than, equal to, or greater than the other.</summary>
|
||||
/// <returns>A signed integer that indicates the relative values of <paramref name="x" /> and <paramref name="y" />, as shown in the following table.Value Meaning Less than zero <paramref name="x" /> is less than <paramref name="y" />.Zero <paramref name="x" /> equals <paramref name="y" />.Greater than zero <paramref name="x" /> is greater than <paramref name="y" />.</returns>
|
||||
/// <param name="x">The first object to compare.</param>
|
||||
/// <param name="y">The second object to compare.</param>
|
||||
/// <exception cref="T:System.ArgumentException">Type <paramref name="T" /> does not implement either the <see cref="T:System.IComparable`1" /> generic interface or the <see cref="T:System.IComparable" /> interface.</exception>
|
||||
// Token: 0x06000C69 RID: 3177
|
||||
public abstract int Compare(T x, T y);
|
||||
|
||||
/// <summary>Returns a default sort order comparer for the type specified by the generic argument.</summary>
|
||||
/// <returns>An object that inherits <see cref="T:System.Collections.Generic.Comparer`1" /> and serves as a sort order comparer for type <paramref name="T" />.</returns>
|
||||
// Token: 0x170001C7 RID: 455
|
||||
// (get) Token: 0x06000C6A RID: 3178 RVA: 0x00038534 File Offset: 0x00036734
|
||||
public static Comparer<T> Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return Comparer<T>._default;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400035F RID: 863
|
||||
private static readonly Comparer<T> _default;
|
||||
|
||||
// Token: 0x020000FC RID: 252
|
||||
private sealed class DefaultComparer : Comparer<T>
|
||||
{
|
||||
// Token: 0x06000C6C RID: 3180 RVA: 0x00038544 File Offset: 0x00036744
|
||||
public override int Compare(T x, T y)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
return (y != null) ? (-1) : 0;
|
||||
}
|
||||
if (y == null)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if (x is IComparable<T>)
|
||||
{
|
||||
return ((IComparable<T>)((object)x)).CompareTo(y);
|
||||
}
|
||||
if (x is IComparable)
|
||||
{
|
||||
return ((IComparable)((object)x)).CompareTo(y);
|
||||
}
|
||||
throw new ArgumentException("does not implement right interface");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,1625 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
/// <summary>Represents a collection of keys and values.</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: 0x020000FF RID: 255
|
||||
[DebuggerTypeProxy(typeof(CollectionDebuggerView<, >))]
|
||||
[DebuggerDisplay("Count={Count}")]
|
||||
[ComVisible(false)]
|
||||
[Serializable]
|
||||
public class Dictionary<TKey, TValue> : IEnumerable, ISerializable, ICollection, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary<TKey, TValue>, IDictionary, IDeserializationCallback
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Dictionary`2" /> class that is empty, has the default initial capacity, and uses the default equality comparer for the key type.</summary>
|
||||
// Token: 0x06000C6F RID: 3183 RVA: 0x00038614 File Offset: 0x00036814
|
||||
public Dictionary()
|
||||
{
|
||||
this.Init(10, null);
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Dictionary`2" /> class that is empty, has the default initial capacity, and uses the specified <see cref="T:System.Collections.Generic.IEqualityComparer`1" />.</summary>
|
||||
/// <param name="comparer">The <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> implementation to use when comparing keys, or null to use the default <see cref="T:System.Collections.Generic.EqualityComparer`1" /> for the type of the key.</param>
|
||||
// Token: 0x06000C70 RID: 3184 RVA: 0x00038628 File Offset: 0x00036828
|
||||
public Dictionary(IEqualityComparer<TKey> comparer)
|
||||
{
|
||||
this.Init(10, comparer);
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Dictionary`2" /> class that contains elements copied from the specified <see cref="T:System.Collections.Generic.IDictionary`2" /> and uses the default equality comparer 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.Dictionary`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: 0x06000C71 RID: 3185 RVA: 0x0003863C File Offset: 0x0003683C
|
||||
public Dictionary(IDictionary<TKey, TValue> dictionary)
|
||||
: this(dictionary, null)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Dictionary`2" /> class that is empty, has the specified initial capacity, and uses the default equality comparer for the key type.</summary>
|
||||
/// <param name="capacity">The initial number of elements that the <see cref="T:System.Collections.Generic.Dictionary`2" /> can contain.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="capacity" /> is less than 0.</exception>
|
||||
// Token: 0x06000C72 RID: 3186 RVA: 0x00038648 File Offset: 0x00036848
|
||||
public Dictionary(int capacity)
|
||||
{
|
||||
this.Init(capacity, null);
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Dictionary`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.IEqualityComparer`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.Dictionary`2" />.</param>
|
||||
/// <param name="comparer">The <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> implementation to use when comparing keys, or null to use the default <see cref="T:System.Collections.Generic.EqualityComparer`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: 0x06000C73 RID: 3187 RVA: 0x00038658 File Offset: 0x00036858
|
||||
public Dictionary(IDictionary<TKey, TValue> dictionary, IEqualityComparer<TKey> comparer)
|
||||
{
|
||||
if (dictionary == null)
|
||||
{
|
||||
throw new ArgumentNullException("dictionary");
|
||||
}
|
||||
int num = dictionary.Count;
|
||||
this.Init(num, comparer);
|
||||
foreach (KeyValuePair<TKey, TValue> keyValuePair in dictionary)
|
||||
{
|
||||
this.Add(keyValuePair.Key, keyValuePair.Value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Dictionary`2" /> class that is empty, has the specified initial capacity, and uses the specified <see cref="T:System.Collections.Generic.IEqualityComparer`1" />.</summary>
|
||||
/// <param name="capacity">The initial number of elements that the <see cref="T:System.Collections.Generic.Dictionary`2" /> can contain.</param>
|
||||
/// <param name="comparer">The <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> implementation to use when comparing keys, or null to use the default <see cref="T:System.Collections.Generic.EqualityComparer`1" /> for the type of the key.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="capacity" /> is less than 0.</exception>
|
||||
// Token: 0x06000C74 RID: 3188 RVA: 0x000386EC File Offset: 0x000368EC
|
||||
public Dictionary(int capacity, IEqualityComparer<TKey> comparer)
|
||||
{
|
||||
this.Init(capacity, comparer);
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Dictionary`2" /> class with serialized data.</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.Dictionary`2" />.</param>
|
||||
/// <param name="context">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> structure containing the source and destination of the serialized stream associated with the <see cref="T:System.Collections.Generic.Dictionary`2" />.</param>
|
||||
// Token: 0x06000C75 RID: 3189 RVA: 0x000386FC File Offset: 0x000368FC
|
||||
protected Dictionary(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
this.serialization_info = info;
|
||||
}
|
||||
|
||||
// Token: 0x170001C8 RID: 456
|
||||
// (get) Token: 0x06000C76 RID: 3190 RVA: 0x0003870C File Offset: 0x0003690C
|
||||
ICollection<TKey> IDictionary<TKey, TValue>.Keys
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Keys;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170001C9 RID: 457
|
||||
// (get) Token: 0x06000C77 RID: 3191 RVA: 0x00038714 File Offset: 0x00036914
|
||||
ICollection<TValue> IDictionary<TKey, TValue>.Values
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Values;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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: 0x170001CA RID: 458
|
||||
// (get) Token: 0x06000C78 RID: 3192 RVA: 0x0003871C File Offset: 0x0003691C
|
||||
ICollection IDictionary.Keys
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Keys;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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: 0x170001CB RID: 459
|
||||
// (get) Token: 0x06000C79 RID: 3193 RVA: 0x00038724 File Offset: 0x00036924
|
||||
ICollection IDictionary.Values
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Values;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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.Dictionary`2" />, this property always returns false.</returns>
|
||||
// Token: 0x170001CC RID: 460
|
||||
// (get) Token: 0x06000C7A RID: 3194 RVA: 0x0003872C File Offset: 0x0003692C
|
||||
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.Dictionary`2" />, this property always returns false.</returns>
|
||||
// Token: 0x170001CD RID: 461
|
||||
// (get) Token: 0x06000C7B RID: 3195 RVA: 0x00038730 File Offset: 0x00036930
|
||||
bool IDictionary.IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value with the specified key.</summary>
|
||||
/// <returns>The value associated 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.Dictionary`2" />.</returns>
|
||||
/// <param name="key">The key of the value 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.Dictionary`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.Dictionary`2" />.</exception>
|
||||
// Token: 0x170001CE RID: 462
|
||||
object IDictionary.this[object key]
|
||||
{
|
||||
get
|
||||
{
|
||||
if (key is TKey && this.ContainsKey((TKey)((object)key)))
|
||||
{
|
||||
return this[this.ToTKey(key)];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
set
|
||||
{
|
||||
this[this.ToTKey(key)] = this.ToTValue(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Adds the specified key and value to the dictionary.</summary>
|
||||
/// <param name="key">The object to use as the key.</param>
|
||||
/// <param name="value">The object to use as the value.</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.Generic.Dictionary`2" />.-or-<paramref name="value" /> is of a type that is not assignable to <paramref name="TValue" />, the type of values in the <see cref="T:System.Collections.Generic.Dictionary`2" />.-or-A value with the same key already exists in the <see cref="T:System.Collections.Generic.Dictionary`2" />.</exception>
|
||||
// Token: 0x06000C7E RID: 3198 RVA: 0x0003878C File Offset: 0x0003698C
|
||||
void IDictionary.Add(object key, object value)
|
||||
{
|
||||
this.Add(this.ToTKey(key), this.ToTValue(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 specified 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: 0x06000C7F RID: 3199 RVA: 0x000387A4 File Offset: 0x000369A4
|
||||
bool IDictionary.Contains(object key)
|
||||
{
|
||||
if (key == null)
|
||||
{
|
||||
throw new ArgumentNullException("key");
|
||||
}
|
||||
return key is TKey && this.ContainsKey((TKey)((object)key));
|
||||
}
|
||||
|
||||
/// <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: 0x06000C80 RID: 3200 RVA: 0x000387DC File Offset: 0x000369DC
|
||||
void IDictionary.Remove(object key)
|
||||
{
|
||||
if (key == null)
|
||||
{
|
||||
throw new ArgumentNullException("key");
|
||||
}
|
||||
if (key is TKey)
|
||||
{
|
||||
this.Remove((TKey)((object)key));
|
||||
}
|
||||
}
|
||||
|
||||
/// <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.Dictionary`2" />, this property always returns false.</returns>
|
||||
// Token: 0x170001CF RID: 463
|
||||
// (get) Token: 0x06000C81 RID: 3201 RVA: 0x00038808 File Offset: 0x00036A08
|
||||
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: 0x170001D0 RID: 464
|
||||
// (get) Token: 0x06000C82 RID: 3202 RVA: 0x0003880C File Offset: 0x00036A0C
|
||||
object ICollection.SyncRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170001D1 RID: 465
|
||||
// (get) Token: 0x06000C83 RID: 3203 RVA: 0x00038810 File Offset: 0x00036A10
|
||||
bool ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000C84 RID: 3204 RVA: 0x00038814 File Offset: 0x00036A14
|
||||
void ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue> keyValuePair)
|
||||
{
|
||||
this.Add(keyValuePair.Key, keyValuePair.Value);
|
||||
}
|
||||
|
||||
// Token: 0x06000C85 RID: 3205 RVA: 0x0003882C File Offset: 0x00036A2C
|
||||
bool ICollection<KeyValuePair<TKey, TValue>>.Contains(KeyValuePair<TKey, TValue> keyValuePair)
|
||||
{
|
||||
return this.ContainsKeyValuePair(keyValuePair);
|
||||
}
|
||||
|
||||
// Token: 0x06000C86 RID: 3206 RVA: 0x00038838 File Offset: 0x00036A38
|
||||
void ICollection<KeyValuePair<TKey, TValue>>.CopyTo(KeyValuePair<TKey, TValue>[] array, int index)
|
||||
{
|
||||
this.CopyTo(array, index);
|
||||
}
|
||||
|
||||
// Token: 0x06000C87 RID: 3207 RVA: 0x00038844 File Offset: 0x00036A44
|
||||
bool ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue> keyValuePair)
|
||||
{
|
||||
return this.ContainsKeyValuePair(keyValuePair) && this.Remove(keyValuePair.Key);
|
||||
}
|
||||
|
||||
/// <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 <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: 0x06000C88 RID: 3208 RVA: 0x00038864 File Offset: 0x00036A64
|
||||
void ICollection.CopyTo(Array array, int index)
|
||||
{
|
||||
KeyValuePair<TKey, TValue>[] array2 = array as KeyValuePair<TKey, TValue>[];
|
||||
if (array2 != null)
|
||||
{
|
||||
this.CopyTo(array2, index);
|
||||
return;
|
||||
}
|
||||
this.CopyToCheck(array, index);
|
||||
DictionaryEntry[] array3 = array as DictionaryEntry[];
|
||||
if (array3 != null)
|
||||
{
|
||||
this.Do_CopyTo<DictionaryEntry, DictionaryEntry>(array3, index, (TKey key, TValue value) => new DictionaryEntry(key, value));
|
||||
return;
|
||||
}
|
||||
this.Do_ICollectionCopyTo<KeyValuePair<TKey, TValue>>(array, index, new Dictionary<TKey, TValue>.Transform<KeyValuePair<TKey, TValue>>(Dictionary<TKey, TValue>.make_pair));
|
||||
}
|
||||
|
||||
/// <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: 0x06000C89 RID: 3209 RVA: 0x000388D8 File Offset: 0x00036AD8
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return new Dictionary<TKey, TValue>.Enumerator(this);
|
||||
}
|
||||
|
||||
// Token: 0x06000C8A RID: 3210 RVA: 0x000388E8 File Offset: 0x00036AE8
|
||||
IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()
|
||||
{
|
||||
return new Dictionary<TKey, TValue>.Enumerator(this);
|
||||
}
|
||||
|
||||
/// <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: 0x06000C8B RID: 3211 RVA: 0x000388F8 File Offset: 0x00036AF8
|
||||
IDictionaryEnumerator IDictionary.GetEnumerator()
|
||||
{
|
||||
return new Dictionary<TKey, TValue>.ShimEnumerator(this);
|
||||
}
|
||||
|
||||
/// <summary>Gets the number of key/value pairs contained in the <see cref="T:System.Collections.Generic.Dictionary`2" />.</summary>
|
||||
/// <returns>The number of key/value pairs contained in the <see cref="T:System.Collections.Generic.Dictionary`2" />.</returns>
|
||||
// Token: 0x170001D2 RID: 466
|
||||
// (get) Token: 0x06000C8C RID: 3212 RVA: 0x00038900 File Offset: 0x00036B00
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.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: 0x170001D3 RID: 467
|
||||
public TValue this[TKey key]
|
||||
{
|
||||
get
|
||||
{
|
||||
if (key == null)
|
||||
{
|
||||
throw new ArgumentNullException("key");
|
||||
}
|
||||
int num = this.hcp.GetHashCode(key) | int.MinValue;
|
||||
for (int num2 = this.table[(num & int.MaxValue) % this.table.Length] - 1; num2 != -1; num2 = this.linkSlots[num2].Next)
|
||||
{
|
||||
if (this.linkSlots[num2].HashCode == num && this.hcp.Equals(this.keySlots[num2], key))
|
||||
{
|
||||
return this.valueSlots[num2];
|
||||
}
|
||||
}
|
||||
throw new KeyNotFoundException();
|
||||
}
|
||||
set
|
||||
{
|
||||
if (key == null)
|
||||
{
|
||||
throw new ArgumentNullException("key");
|
||||
}
|
||||
int num = this.hcp.GetHashCode(key) | int.MinValue;
|
||||
int num2 = (num & int.MaxValue) % this.table.Length;
|
||||
int num3 = this.table[num2] - 1;
|
||||
int num4 = -1;
|
||||
if (num3 != -1)
|
||||
{
|
||||
while (this.linkSlots[num3].HashCode != num || !this.hcp.Equals(this.keySlots[num3], key))
|
||||
{
|
||||
num4 = num3;
|
||||
num3 = this.linkSlots[num3].Next;
|
||||
if (num3 == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (num3 == -1)
|
||||
{
|
||||
if (++this.count > this.threshold)
|
||||
{
|
||||
this.Resize();
|
||||
num2 = (num & int.MaxValue) % this.table.Length;
|
||||
}
|
||||
num3 = this.emptySlot;
|
||||
if (num3 == -1)
|
||||
{
|
||||
num3 = this.touchedSlots++;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.emptySlot = this.linkSlots[num3].Next;
|
||||
}
|
||||
this.linkSlots[num3].Next = this.table[num2] - 1;
|
||||
this.table[num2] = num3 + 1;
|
||||
this.linkSlots[num3].HashCode = num;
|
||||
this.keySlots[num3] = key;
|
||||
}
|
||||
else if (num4 != -1)
|
||||
{
|
||||
this.linkSlots[num4].Next = this.linkSlots[num3].Next;
|
||||
this.linkSlots[num3].Next = this.table[num2] - 1;
|
||||
this.table[num2] = num3 + 1;
|
||||
}
|
||||
this.valueSlots[num3] = value;
|
||||
this.generation++;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000C8F RID: 3215 RVA: 0x00038B9C File Offset: 0x00036D9C
|
||||
private void Init(int capacity, IEqualityComparer<TKey> hcp)
|
||||
{
|
||||
if (capacity < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("capacity");
|
||||
}
|
||||
this.hcp = ((hcp == null) ? EqualityComparer<TKey>.Default : hcp);
|
||||
if (capacity == 0)
|
||||
{
|
||||
capacity = 10;
|
||||
}
|
||||
capacity = (int)((float)capacity / 0.9f) + 1;
|
||||
this.InitArrays(capacity);
|
||||
this.generation = 0;
|
||||
}
|
||||
|
||||
// Token: 0x06000C90 RID: 3216 RVA: 0x00038BFC File Offset: 0x00036DFC
|
||||
private void InitArrays(int size)
|
||||
{
|
||||
this.table = new int[size];
|
||||
this.linkSlots = new Link[size];
|
||||
this.emptySlot = -1;
|
||||
this.keySlots = new TKey[size];
|
||||
this.valueSlots = new TValue[size];
|
||||
this.touchedSlots = 0;
|
||||
this.threshold = (int)((float)this.table.Length * 0.9f);
|
||||
if (this.threshold == 0 && this.table.Length > 0)
|
||||
{
|
||||
this.threshold = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000C91 RID: 3217 RVA: 0x00038C80 File Offset: 0x00036E80
|
||||
private void CopyToCheck(Array array, int index)
|
||||
{
|
||||
if (array == null)
|
||||
{
|
||||
throw new ArgumentNullException("array");
|
||||
}
|
||||
if (index < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("index");
|
||||
}
|
||||
if (index > array.Length)
|
||||
{
|
||||
throw new ArgumentException("index larger than largest valid index of array");
|
||||
}
|
||||
if (array.Length - index < this.Count)
|
||||
{
|
||||
throw new ArgumentException("Destination array cannot hold the requested elements!");
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000C92 RID: 3218 RVA: 0x00038CE8 File Offset: 0x00036EE8
|
||||
private void Do_CopyTo<TRet, TElem>(TElem[] array, int index, Dictionary<TKey, TValue>.Transform<TRet> transform) where TRet : TElem
|
||||
{
|
||||
for (int i = 0; i < this.touchedSlots; i++)
|
||||
{
|
||||
if ((this.linkSlots[i].HashCode & -2147483648) != 0)
|
||||
{
|
||||
array[index++] = (TElem)((object)transform(this.keySlots[i], this.valueSlots[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000C93 RID: 3219 RVA: 0x00038D5C File Offset: 0x00036F5C
|
||||
private static KeyValuePair<TKey, TValue> make_pair(TKey key, TValue value)
|
||||
{
|
||||
return new KeyValuePair<TKey, TValue>(key, value);
|
||||
}
|
||||
|
||||
// Token: 0x06000C94 RID: 3220 RVA: 0x00038D68 File Offset: 0x00036F68
|
||||
private static TKey pick_key(TKey key, TValue value)
|
||||
{
|
||||
return key;
|
||||
}
|
||||
|
||||
// Token: 0x06000C95 RID: 3221 RVA: 0x00038D6C File Offset: 0x00036F6C
|
||||
private static TValue pick_value(TKey key, TValue value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
// Token: 0x06000C96 RID: 3222 RVA: 0x00038D70 File Offset: 0x00036F70
|
||||
private void CopyTo(KeyValuePair<TKey, TValue>[] array, int index)
|
||||
{
|
||||
this.CopyToCheck(array, index);
|
||||
this.Do_CopyTo<KeyValuePair<TKey, TValue>, KeyValuePair<TKey, TValue>>(array, index, new Dictionary<TKey, TValue>.Transform<KeyValuePair<TKey, TValue>>(Dictionary<TKey, TValue>.make_pair));
|
||||
}
|
||||
|
||||
// Token: 0x06000C97 RID: 3223 RVA: 0x00038D9C File Offset: 0x00036F9C
|
||||
private void Do_ICollectionCopyTo<TRet>(Array array, int index, Dictionary<TKey, TValue>.Transform<TRet> transform)
|
||||
{
|
||||
Type typeFromHandle = typeof(TRet);
|
||||
Type elementType = array.GetType().GetElementType();
|
||||
try
|
||||
{
|
||||
if ((typeFromHandle.IsPrimitive || elementType.IsPrimitive) && !elementType.IsAssignableFrom(typeFromHandle))
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
this.Do_CopyTo<TRet, object>((object[])array, index, transform);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ArgumentException("Cannot copy source collection elements to destination array", "array", ex);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000C98 RID: 3224 RVA: 0x00038E30 File Offset: 0x00037030
|
||||
private void Resize()
|
||||
{
|
||||
int num = Hashtable.ToPrime((this.table.Length << 1) | 1);
|
||||
int[] array = new int[num];
|
||||
Link[] array2 = new Link[num];
|
||||
for (int i = 0; i < this.table.Length; i++)
|
||||
{
|
||||
for (int num2 = this.table[i] - 1; num2 != -1; num2 = this.linkSlots[num2].Next)
|
||||
{
|
||||
int num3 = (array2[num2].HashCode = this.hcp.GetHashCode(this.keySlots[num2]) | int.MinValue);
|
||||
int num4 = (num3 & int.MaxValue) % num;
|
||||
array2[num2].Next = array[num4] - 1;
|
||||
array[num4] = num2 + 1;
|
||||
}
|
||||
}
|
||||
this.table = array;
|
||||
this.linkSlots = array2;
|
||||
TKey[] array3 = new TKey[num];
|
||||
TValue[] array4 = new TValue[num];
|
||||
Array.Copy(this.keySlots, 0, array3, 0, this.touchedSlots);
|
||||
Array.Copy(this.valueSlots, 0, array4, 0, this.touchedSlots);
|
||||
this.keySlots = array3;
|
||||
this.valueSlots = array4;
|
||||
this.threshold = (int)((float)num * 0.9f);
|
||||
}
|
||||
|
||||
/// <summary>Adds the specified key and value to the dictionary.</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.Dictionary`2" />.</exception>
|
||||
// Token: 0x06000C99 RID: 3225 RVA: 0x00038F64 File Offset: 0x00037164
|
||||
public void Add(TKey key, TValue value)
|
||||
{
|
||||
if (key == null)
|
||||
{
|
||||
throw new ArgumentNullException("key");
|
||||
}
|
||||
int num = this.hcp.GetHashCode(key) | int.MinValue;
|
||||
int num2 = (num & int.MaxValue) % this.table.Length;
|
||||
int num3;
|
||||
for (num3 = this.table[num2] - 1; num3 != -1; num3 = this.linkSlots[num3].Next)
|
||||
{
|
||||
if (this.linkSlots[num3].HashCode == num && this.hcp.Equals(this.keySlots[num3], key))
|
||||
{
|
||||
throw new ArgumentException("An element with the same key already exists in the dictionary.");
|
||||
}
|
||||
}
|
||||
if (++this.count > this.threshold)
|
||||
{
|
||||
this.Resize();
|
||||
num2 = (num & int.MaxValue) % this.table.Length;
|
||||
}
|
||||
num3 = this.emptySlot;
|
||||
if (num3 == -1)
|
||||
{
|
||||
num3 = this.touchedSlots++;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.emptySlot = this.linkSlots[num3].Next;
|
||||
}
|
||||
this.linkSlots[num3].HashCode = num;
|
||||
this.linkSlots[num3].Next = this.table[num2] - 1;
|
||||
this.table[num2] = num3 + 1;
|
||||
this.keySlots[num3] = key;
|
||||
this.valueSlots[num3] = value;
|
||||
this.generation++;
|
||||
}
|
||||
|
||||
/// <summary>Gets the <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> that is used to determine equality of keys for the dictionary. </summary>
|
||||
/// <returns>The <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> generic interface implementation that is used to determine equality of keys for the current <see cref="T:System.Collections.Generic.Dictionary`2" /> and to provide hash values for the keys.</returns>
|
||||
// Token: 0x170001D4 RID: 468
|
||||
// (get) Token: 0x06000C9A RID: 3226 RVA: 0x000390E4 File Offset: 0x000372E4
|
||||
public IEqualityComparer<TKey> Comparer
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.hcp;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Removes all keys and values from the <see cref="T:System.Collections.Generic.Dictionary`2" />.</summary>
|
||||
// Token: 0x06000C9B RID: 3227 RVA: 0x000390EC File Offset: 0x000372EC
|
||||
public void Clear()
|
||||
{
|
||||
this.count = 0;
|
||||
Array.Clear(this.table, 0, this.table.Length);
|
||||
Array.Clear(this.keySlots, 0, this.keySlots.Length);
|
||||
Array.Clear(this.valueSlots, 0, this.valueSlots.Length);
|
||||
Array.Clear(this.linkSlots, 0, this.linkSlots.Length);
|
||||
this.emptySlot = -1;
|
||||
this.touchedSlots = 0;
|
||||
this.generation++;
|
||||
}
|
||||
|
||||
/// <summary>Determines whether the <see cref="T:System.Collections.Generic.Dictionary`2" /> contains the specified key.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Collections.Generic.Dictionary`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.Dictionary`2" />.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="key" /> is null.</exception>
|
||||
// Token: 0x06000C9C RID: 3228 RVA: 0x0003916C File Offset: 0x0003736C
|
||||
public bool ContainsKey(TKey key)
|
||||
{
|
||||
if (key == null)
|
||||
{
|
||||
throw new ArgumentNullException("key");
|
||||
}
|
||||
int num = this.hcp.GetHashCode(key) | int.MinValue;
|
||||
for (int num2 = this.table[(num & int.MaxValue) % this.table.Length] - 1; num2 != -1; num2 = this.linkSlots[num2].Next)
|
||||
{
|
||||
if (this.linkSlots[num2].HashCode == num && this.hcp.Equals(this.keySlots[num2], key))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>Determines whether the <see cref="T:System.Collections.Generic.Dictionary`2" /> contains a specific value.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Collections.Generic.Dictionary`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.Dictionary`2" />. The value can be null for reference types.</param>
|
||||
// Token: 0x06000C9D RID: 3229 RVA: 0x00039214 File Offset: 0x00037414
|
||||
public bool ContainsValue(TValue value)
|
||||
{
|
||||
IEqualityComparer<TValue> @default = EqualityComparer<TValue>.Default;
|
||||
for (int i = 0; i < this.table.Length; i++)
|
||||
{
|
||||
for (int num = this.table[i] - 1; num != -1; num = this.linkSlots[num].Next)
|
||||
{
|
||||
if (@default.Equals(this.valueSlots[num], value))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <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.Dictionary`2" /> 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.Dictionary`2" /> instance.</param>
|
||||
/// <param name="context">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> structure that contains the source and destination of the serialized stream associated with the <see cref="T:System.Collections.Generic.Dictionary`2" /> instance.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="info" /> is null.</exception>
|
||||
// Token: 0x06000C9E RID: 3230 RVA: 0x00039284 File Offset: 0x00037484
|
||||
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
if (info == null)
|
||||
{
|
||||
throw new ArgumentNullException("info");
|
||||
}
|
||||
info.AddValue("Version", this.generation);
|
||||
info.AddValue("Comparer", this.hcp);
|
||||
KeyValuePair<TKey, TValue>[] array = null;
|
||||
if (this.count > 0)
|
||||
{
|
||||
array = new KeyValuePair<TKey, TValue>[this.count];
|
||||
this.CopyTo(array, 0);
|
||||
}
|
||||
info.AddValue("HashSize", this.table.Length);
|
||||
info.AddValue("KeyValuePairs", array);
|
||||
}
|
||||
|
||||
/// <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.Dictionary`2" /> instance is invalid.</exception>
|
||||
// Token: 0x06000C9F RID: 3231 RVA: 0x00039308 File Offset: 0x00037508
|
||||
public virtual void OnDeserialization(object sender)
|
||||
{
|
||||
if (this.serialization_info == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.generation = this.serialization_info.GetInt32("Version");
|
||||
this.hcp = (IEqualityComparer<TKey>)this.serialization_info.GetValue("Comparer", typeof(IEqualityComparer<TKey>));
|
||||
int num = this.serialization_info.GetInt32("HashSize");
|
||||
KeyValuePair<TKey, TValue>[] array = (KeyValuePair<TKey, TValue>[])this.serialization_info.GetValue("KeyValuePairs", typeof(KeyValuePair<TKey, TValue>[]));
|
||||
if (num < 10)
|
||||
{
|
||||
num = 10;
|
||||
}
|
||||
this.InitArrays(num);
|
||||
this.count = 0;
|
||||
if (array != null)
|
||||
{
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
this.Add(array[i].Key, array[i].Value);
|
||||
}
|
||||
}
|
||||
this.generation++;
|
||||
this.serialization_info = null;
|
||||
}
|
||||
|
||||
/// <summary>Removes the value with the specified key from the <see cref="T:System.Collections.Generic.Dictionary`2" />.</summary>
|
||||
/// <returns>true if the element is successfully found and removed; otherwise, false. This method returns false if <paramref name="key" /> is not found in the <see cref="T:System.Collections.Generic.Dictionary`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: 0x06000CA0 RID: 3232 RVA: 0x000393F4 File Offset: 0x000375F4
|
||||
public bool Remove(TKey key)
|
||||
{
|
||||
if (key == null)
|
||||
{
|
||||
throw new ArgumentNullException("key");
|
||||
}
|
||||
int num = this.hcp.GetHashCode(key) | int.MinValue;
|
||||
int num2 = (num & int.MaxValue) % this.table.Length;
|
||||
int num3 = this.table[num2] - 1;
|
||||
if (num3 == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int num4 = -1;
|
||||
while (this.linkSlots[num3].HashCode != num || !this.hcp.Equals(this.keySlots[num3], key))
|
||||
{
|
||||
num4 = num3;
|
||||
num3 = this.linkSlots[num3].Next;
|
||||
if (num3 == -1)
|
||||
{
|
||||
IL_A4:
|
||||
if (num3 == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.count--;
|
||||
if (num4 == -1)
|
||||
{
|
||||
this.table[num2] = this.linkSlots[num3].Next + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.linkSlots[num4].Next = this.linkSlots[num3].Next;
|
||||
}
|
||||
this.linkSlots[num3].Next = this.emptySlot;
|
||||
this.emptySlot = num3;
|
||||
this.linkSlots[num3].HashCode = 0;
|
||||
this.keySlots[num3] = default(TKey);
|
||||
this.valueSlots[num3] = default(TValue);
|
||||
this.generation++;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
goto IL_A4;
|
||||
}
|
||||
|
||||
/// <summary>Gets the value associated with the specified key.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Collections.Generic.Dictionary`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, contains 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: 0x06000CA1 RID: 3233 RVA: 0x00039570 File Offset: 0x00037770
|
||||
public bool TryGetValue(TKey key, out TValue value)
|
||||
{
|
||||
if (key == null)
|
||||
{
|
||||
throw new ArgumentNullException("key");
|
||||
}
|
||||
int num = this.hcp.GetHashCode(key) | int.MinValue;
|
||||
for (int num2 = this.table[(num & int.MaxValue) % this.table.Length] - 1; num2 != -1; num2 = this.linkSlots[num2].Next)
|
||||
{
|
||||
if (this.linkSlots[num2].HashCode == num && this.hcp.Equals(this.keySlots[num2], key))
|
||||
{
|
||||
value = this.valueSlots[num2];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
value = default(TValue);
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>Gets a collection containing the keys in the <see cref="T:System.Collections.Generic.Dictionary`2" />.</summary>
|
||||
/// <returns>A <see cref="T:System.Collections.Generic.Dictionary`2.KeyCollection" /> containing the keys in the <see cref="T:System.Collections.Generic.Dictionary`2" />.</returns>
|
||||
// Token: 0x170001D5 RID: 469
|
||||
// (get) Token: 0x06000CA2 RID: 3234 RVA: 0x00039638 File Offset: 0x00037838
|
||||
public Dictionary<TKey, TValue>.KeyCollection Keys
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Dictionary<TKey, TValue>.KeyCollection(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a collection containing the values in the <see cref="T:System.Collections.Generic.Dictionary`2" />.</summary>
|
||||
/// <returns>A <see cref="T:System.Collections.Generic.Dictionary`2.ValueCollection" /> containing the values in the <see cref="T:System.Collections.Generic.Dictionary`2" />.</returns>
|
||||
// Token: 0x170001D6 RID: 470
|
||||
// (get) Token: 0x06000CA3 RID: 3235 RVA: 0x00039640 File Offset: 0x00037840
|
||||
public Dictionary<TKey, TValue>.ValueCollection Values
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Dictionary<TKey, TValue>.ValueCollection(this);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000CA4 RID: 3236 RVA: 0x00039648 File Offset: 0x00037848
|
||||
private TKey ToTKey(object key)
|
||||
{
|
||||
if (key == null)
|
||||
{
|
||||
throw new ArgumentNullException("key");
|
||||
}
|
||||
if (!(key is TKey))
|
||||
{
|
||||
throw new ArgumentException("not of type: " + typeof(TKey).ToString(), "key");
|
||||
}
|
||||
return (TKey)((object)key);
|
||||
}
|
||||
|
||||
// Token: 0x06000CA5 RID: 3237 RVA: 0x0003969C File Offset: 0x0003789C
|
||||
private TValue ToTValue(object value)
|
||||
{
|
||||
if (value == null && !typeof(TValue).IsValueType)
|
||||
{
|
||||
return default(TValue);
|
||||
}
|
||||
if (!(value is TValue))
|
||||
{
|
||||
throw new ArgumentException("not of type: " + typeof(TValue).ToString(), "value");
|
||||
}
|
||||
return (TValue)((object)value);
|
||||
}
|
||||
|
||||
// Token: 0x06000CA6 RID: 3238 RVA: 0x00039704 File Offset: 0x00037904
|
||||
private bool ContainsKeyValuePair(KeyValuePair<TKey, TValue> pair)
|
||||
{
|
||||
TValue tvalue;
|
||||
return this.TryGetValue(pair.Key, out tvalue) && EqualityComparer<TValue>.Default.Equals(pair.Value, tvalue);
|
||||
}
|
||||
|
||||
/// <summary>Returns an enumerator that iterates through the <see cref="T:System.Collections.Generic.Dictionary`2" />.</summary>
|
||||
/// <returns>A <see cref="T:System.Collections.Generic.Dictionary`2.Enumerator" /> structure for the <see cref="T:System.Collections.Generic.Dictionary`2" />.</returns>
|
||||
// Token: 0x06000CA7 RID: 3239 RVA: 0x0003973C File Offset: 0x0003793C
|
||||
public Dictionary<TKey, TValue>.Enumerator GetEnumerator()
|
||||
{
|
||||
return new Dictionary<TKey, TValue>.Enumerator(this);
|
||||
}
|
||||
|
||||
// Token: 0x04000362 RID: 866
|
||||
private const int INITIAL_SIZE = 10;
|
||||
|
||||
// Token: 0x04000363 RID: 867
|
||||
private const float DEFAULT_LOAD_FACTOR = 0.9f;
|
||||
|
||||
// Token: 0x04000364 RID: 868
|
||||
private const int NO_SLOT = -1;
|
||||
|
||||
// Token: 0x04000365 RID: 869
|
||||
private const int HASH_FLAG = -2147483648;
|
||||
|
||||
// Token: 0x04000366 RID: 870
|
||||
private int[] table;
|
||||
|
||||
// Token: 0x04000367 RID: 871
|
||||
private Link[] linkSlots;
|
||||
|
||||
// Token: 0x04000368 RID: 872
|
||||
private TKey[] keySlots;
|
||||
|
||||
// Token: 0x04000369 RID: 873
|
||||
private TValue[] valueSlots;
|
||||
|
||||
// Token: 0x0400036A RID: 874
|
||||
private int touchedSlots;
|
||||
|
||||
// Token: 0x0400036B RID: 875
|
||||
private int emptySlot;
|
||||
|
||||
// Token: 0x0400036C RID: 876
|
||||
private int count;
|
||||
|
||||
// Token: 0x0400036D RID: 877
|
||||
private int threshold;
|
||||
|
||||
// Token: 0x0400036E RID: 878
|
||||
private IEqualityComparer<TKey> hcp;
|
||||
|
||||
// Token: 0x0400036F RID: 879
|
||||
private SerializationInfo serialization_info;
|
||||
|
||||
// Token: 0x04000370 RID: 880
|
||||
private int generation;
|
||||
|
||||
// Token: 0x02000100 RID: 256
|
||||
[Serializable]
|
||||
private class ShimEnumerator : IEnumerator, IDictionaryEnumerator
|
||||
{
|
||||
// Token: 0x06000CA9 RID: 3241 RVA: 0x00039758 File Offset: 0x00037958
|
||||
public ShimEnumerator(Dictionary<TKey, TValue> host)
|
||||
{
|
||||
this.host_enumerator = host.GetEnumerator();
|
||||
}
|
||||
|
||||
// Token: 0x06000CAA RID: 3242 RVA: 0x0003976C File Offset: 0x0003796C
|
||||
public void Dispose()
|
||||
{
|
||||
this.host_enumerator.Dispose();
|
||||
}
|
||||
|
||||
// Token: 0x06000CAB RID: 3243 RVA: 0x0003977C File Offset: 0x0003797C
|
||||
public bool MoveNext()
|
||||
{
|
||||
return this.host_enumerator.MoveNext();
|
||||
}
|
||||
|
||||
// Token: 0x170001D7 RID: 471
|
||||
// (get) Token: 0x06000CAC RID: 3244 RVA: 0x0003978C File Offset: 0x0003798C
|
||||
public DictionaryEntry Entry
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((IDictionaryEnumerator)this.host_enumerator).Entry;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170001D8 RID: 472
|
||||
// (get) Token: 0x06000CAD RID: 3245 RVA: 0x000397A0 File Offset: 0x000379A0
|
||||
public object Key
|
||||
{
|
||||
get
|
||||
{
|
||||
KeyValuePair<TKey, TValue> keyValuePair = this.host_enumerator.Current;
|
||||
return keyValuePair.Key;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170001D9 RID: 473
|
||||
// (get) Token: 0x06000CAE RID: 3246 RVA: 0x000397C8 File Offset: 0x000379C8
|
||||
public object Value
|
||||
{
|
||||
get
|
||||
{
|
||||
KeyValuePair<TKey, TValue> keyValuePair = this.host_enumerator.Current;
|
||||
return keyValuePair.Value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170001DA RID: 474
|
||||
// (get) Token: 0x06000CAF RID: 3247 RVA: 0x000397F0 File Offset: 0x000379F0
|
||||
public object Current
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Entry;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000CB0 RID: 3248 RVA: 0x00039800 File Offset: 0x00037A00
|
||||
public void Reset()
|
||||
{
|
||||
this.host_enumerator.Reset();
|
||||
}
|
||||
|
||||
// Token: 0x04000372 RID: 882
|
||||
private Dictionary<TKey, TValue>.Enumerator host_enumerator;
|
||||
}
|
||||
|
||||
/// <summary>Enumerates the elements of a <see cref="T:System.Collections.Generic.Dictionary`2" />.</summary>
|
||||
// Token: 0x02000101 RID: 257
|
||||
[Serializable]
|
||||
public struct Enumerator : IEnumerator, IDisposable, IEnumerator<KeyValuePair<TKey, TValue>>, IDictionaryEnumerator
|
||||
{
|
||||
// Token: 0x06000CB1 RID: 3249 RVA: 0x00039810 File Offset: 0x00037A10
|
||||
internal Enumerator(Dictionary<TKey, TValue> dictionary)
|
||||
{
|
||||
this.dictionary = dictionary;
|
||||
this.stamp = dictionary.generation;
|
||||
}
|
||||
|
||||
/// <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, as an <see cref="T:System.Object" />.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The enumerator is positioned before the first element of the collection or after the last element. </exception>
|
||||
// Token: 0x170001DB RID: 475
|
||||
// (get) Token: 0x06000CB2 RID: 3250 RVA: 0x00039828 File Offset: 0x00037A28
|
||||
object IEnumerator.Current
|
||||
{
|
||||
get
|
||||
{
|
||||
this.VerifyCurrent();
|
||||
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: 0x06000CB3 RID: 3251 RVA: 0x0003983C File Offset: 0x00037A3C
|
||||
void IEnumerator.Reset()
|
||||
{
|
||||
this.Reset();
|
||||
}
|
||||
|
||||
/// <summary>Gets the element at the current position of the enumerator.</summary>
|
||||
/// <returns>The element in the dictionary at the current position of the enumerator, as a <see cref="T:System.Collections.DictionaryEntry" />.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The enumerator is positioned before the first element of the collection or after the last element. </exception>
|
||||
// Token: 0x170001DC RID: 476
|
||||
// (get) Token: 0x06000CB4 RID: 3252 RVA: 0x00039844 File Offset: 0x00037A44
|
||||
DictionaryEntry IDictionaryEnumerator.Entry
|
||||
{
|
||||
get
|
||||
{
|
||||
this.VerifyCurrent();
|
||||
return new DictionaryEntry(this.current.Key, this.current.Value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the key of the element at the current position of the enumerator.</summary>
|
||||
/// <returns>The key of the element in the dictionary 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: 0x170001DD RID: 477
|
||||
// (get) Token: 0x06000CB5 RID: 3253 RVA: 0x0003987C File Offset: 0x00037A7C
|
||||
object IDictionaryEnumerator.Key
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.CurrentKey;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the value of the element at the current position of the enumerator.</summary>
|
||||
/// <returns>The value of the element in the dictionary 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: 0x170001DE RID: 478
|
||||
// (get) Token: 0x06000CB6 RID: 3254 RVA: 0x0003988C File Offset: 0x00037A8C
|
||||
object IDictionaryEnumerator.Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.CurrentValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Advances the enumerator to the next element of the <see cref="T:System.Collections.Generic.Dictionary`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: 0x06000CB7 RID: 3255 RVA: 0x0003989C File Offset: 0x00037A9C
|
||||
public bool MoveNext()
|
||||
{
|
||||
this.VerifyState();
|
||||
if (this.next < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
while (this.next < this.dictionary.touchedSlots)
|
||||
{
|
||||
int num = this.next++;
|
||||
if ((this.dictionary.linkSlots[num].HashCode & -2147483648) != 0)
|
||||
{
|
||||
this.current = new KeyValuePair<TKey, TValue>(this.dictionary.keySlots[num], this.dictionary.valueSlots[num]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
this.next = -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>Gets the element at the current position of the enumerator.</summary>
|
||||
/// <returns>The element in the <see cref="T:System.Collections.Generic.Dictionary`2" /> at the current position of the enumerator.</returns>
|
||||
// Token: 0x170001DF RID: 479
|
||||
// (get) Token: 0x06000CB8 RID: 3256 RVA: 0x00039944 File Offset: 0x00037B44
|
||||
public KeyValuePair<TKey, TValue> Current
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.current;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170001E0 RID: 480
|
||||
// (get) Token: 0x06000CB9 RID: 3257 RVA: 0x0003994C File Offset: 0x00037B4C
|
||||
internal TKey CurrentKey
|
||||
{
|
||||
get
|
||||
{
|
||||
this.VerifyCurrent();
|
||||
return this.current.Key;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170001E1 RID: 481
|
||||
// (get) Token: 0x06000CBA RID: 3258 RVA: 0x00039960 File Offset: 0x00037B60
|
||||
internal TValue CurrentValue
|
||||
{
|
||||
get
|
||||
{
|
||||
this.VerifyCurrent();
|
||||
return this.current.Value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000CBB RID: 3259 RVA: 0x00039974 File Offset: 0x00037B74
|
||||
internal void Reset()
|
||||
{
|
||||
this.VerifyState();
|
||||
this.next = 0;
|
||||
}
|
||||
|
||||
// Token: 0x06000CBC RID: 3260 RVA: 0x00039984 File Offset: 0x00037B84
|
||||
private void VerifyState()
|
||||
{
|
||||
if (this.dictionary == null)
|
||||
{
|
||||
throw new ObjectDisposedException(null);
|
||||
}
|
||||
if (this.dictionary.generation != this.stamp)
|
||||
{
|
||||
throw new InvalidOperationException("out of sync");
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000CBD RID: 3261 RVA: 0x000399BC File Offset: 0x00037BBC
|
||||
private void VerifyCurrent()
|
||||
{
|
||||
this.VerifyState();
|
||||
if (this.next <= 0)
|
||||
{
|
||||
throw new InvalidOperationException("Current is not valid");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Releases all resources used by the <see cref="T:System.Collections.Generic.Dictionary`2.Enumerator" />.</summary>
|
||||
// Token: 0x06000CBE RID: 3262 RVA: 0x000399DC File Offset: 0x00037BDC
|
||||
public void Dispose()
|
||||
{
|
||||
this.dictionary = null;
|
||||
}
|
||||
|
||||
// Token: 0x04000373 RID: 883
|
||||
private Dictionary<TKey, TValue> dictionary;
|
||||
|
||||
// Token: 0x04000374 RID: 884
|
||||
private int next;
|
||||
|
||||
// Token: 0x04000375 RID: 885
|
||||
private int stamp;
|
||||
|
||||
// Token: 0x04000376 RID: 886
|
||||
internal KeyValuePair<TKey, TValue> current;
|
||||
}
|
||||
|
||||
/// <summary>Represents the collection of keys in a <see cref="T:System.Collections.Generic.Dictionary`2" />. This class cannot be inherited. </summary>
|
||||
// Token: 0x02000102 RID: 258
|
||||
[DebuggerDisplay("Count={Count}")]
|
||||
[DebuggerTypeProxy(typeof(CollectionDebuggerView<, >))]
|
||||
[Serializable]
|
||||
public sealed class KeyCollection : IEnumerable, ICollection, ICollection<TKey>, IEnumerable<TKey>
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Dictionary`2.KeyCollection" /> class that reflects the keys in the specified <see cref="T:System.Collections.Generic.Dictionary`2" />.</summary>
|
||||
/// <param name="dictionary">The <see cref="T:System.Collections.Generic.Dictionary`2" /> whose keys are reflected in the new <see cref="T:System.Collections.Generic.Dictionary`2.KeyCollection" />.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="dictionary" /> is null.</exception>
|
||||
// Token: 0x06000CBF RID: 3263 RVA: 0x000399E8 File Offset: 0x00037BE8
|
||||
public KeyCollection(Dictionary<TKey, TValue> dictionary)
|
||||
{
|
||||
if (dictionary == null)
|
||||
{
|
||||
throw new ArgumentNullException("dictionary");
|
||||
}
|
||||
this.dictionary = dictionary;
|
||||
}
|
||||
|
||||
// Token: 0x06000CC0 RID: 3264 RVA: 0x00039A08 File Offset: 0x00037C08
|
||||
void ICollection<TKey>.Add(TKey item)
|
||||
{
|
||||
throw new NotSupportedException("this is a read-only collection");
|
||||
}
|
||||
|
||||
// Token: 0x06000CC1 RID: 3265 RVA: 0x00039A14 File Offset: 0x00037C14
|
||||
void ICollection<TKey>.Clear()
|
||||
{
|
||||
throw new NotSupportedException("this is a read-only collection");
|
||||
}
|
||||
|
||||
// Token: 0x06000CC2 RID: 3266 RVA: 0x00039A20 File Offset: 0x00037C20
|
||||
bool ICollection<TKey>.Contains(TKey item)
|
||||
{
|
||||
return this.dictionary.ContainsKey(item);
|
||||
}
|
||||
|
||||
// Token: 0x06000CC3 RID: 3267 RVA: 0x00039A30 File Offset: 0x00037C30
|
||||
bool ICollection<TKey>.Remove(TKey item)
|
||||
{
|
||||
throw new NotSupportedException("this is a read-only collection");
|
||||
}
|
||||
|
||||
// Token: 0x06000CC4 RID: 3268 RVA: 0x00039A3C File Offset: 0x00037C3C
|
||||
IEnumerator<TKey> IEnumerable<TKey>.GetEnumerator()
|
||||
{
|
||||
return this.GetEnumerator();
|
||||
}
|
||||
|
||||
/// <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: 0x06000CC5 RID: 3269 RVA: 0x00039A4C File Offset: 0x00037C4C
|
||||
void ICollection.CopyTo(Array array, int index)
|
||||
{
|
||||
TKey[] array2 = array as TKey[];
|
||||
if (array2 != null)
|
||||
{
|
||||
this.CopyTo(array2, index);
|
||||
return;
|
||||
}
|
||||
this.dictionary.CopyToCheck(array, index);
|
||||
this.dictionary.Do_ICollectionCopyTo<TKey>(array, index, new Dictionary<TKey, TValue>.Transform<TKey>(Dictionary<TKey, TValue>.pick_key));
|
||||
}
|
||||
|
||||
/// <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: 0x06000CC6 RID: 3270 RVA: 0x00039A98 File Offset: 0x00037C98
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return this.GetEnumerator();
|
||||
}
|
||||
|
||||
// Token: 0x170001E2 RID: 482
|
||||
// (get) Token: 0x06000CC7 RID: 3271 RVA: 0x00039AA8 File Offset: 0x00037CA8
|
||||
bool ICollection<TKey>.IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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.Dictionary`2.KeyCollection" />, this property always returns false.</returns>
|
||||
// Token: 0x170001E3 RID: 483
|
||||
// (get) Token: 0x06000CC8 RID: 3272 RVA: 0x00039AAC File Offset: 0x00037CAC
|
||||
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.Dictionary`2.KeyCollection" />, this property always returns the current instance.</returns>
|
||||
// Token: 0x170001E4 RID: 484
|
||||
// (get) Token: 0x06000CC9 RID: 3273 RVA: 0x00039AB0 File Offset: 0x00037CB0
|
||||
object ICollection.SyncRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((ICollection)this.dictionary).SyncRoot;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Copies the <see cref="T:System.Collections.Generic.Dictionary`2.KeyCollection" /> 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.Dictionary`2.KeyCollection" />. 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.Dictionary`2.KeyCollection" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.</exception>
|
||||
// Token: 0x06000CCA RID: 3274 RVA: 0x00039AC0 File Offset: 0x00037CC0
|
||||
public void CopyTo(TKey[] array, int index)
|
||||
{
|
||||
this.dictionary.CopyToCheck(array, index);
|
||||
this.dictionary.Do_CopyTo<TKey, TKey>(array, index, new Dictionary<TKey, TValue>.Transform<TKey>(Dictionary<TKey, TValue>.pick_key));
|
||||
}
|
||||
|
||||
/// <summary>Returns an enumerator that iterates through the <see cref="T:System.Collections.Generic.Dictionary`2.KeyCollection" />.</summary>
|
||||
/// <returns>A <see cref="T:System.Collections.Generic.Dictionary`2.KeyCollection.Enumerator" /> for the <see cref="T:System.Collections.Generic.Dictionary`2.KeyCollection" />.</returns>
|
||||
// Token: 0x06000CCB RID: 3275 RVA: 0x00039AF4 File Offset: 0x00037CF4
|
||||
public Dictionary<TKey, TValue>.KeyCollection.Enumerator GetEnumerator()
|
||||
{
|
||||
return new Dictionary<TKey, TValue>.KeyCollection.Enumerator(this.dictionary);
|
||||
}
|
||||
|
||||
/// <summary>Gets the number of elements contained in the <see cref="T:System.Collections.Generic.Dictionary`2.KeyCollection" />.</summary>
|
||||
/// <returns>The number of elements contained in the <see cref="T:System.Collections.Generic.Dictionary`2.KeyCollection" />.Retrieving the value of this property is an O(1) operation.</returns>
|
||||
// Token: 0x170001E5 RID: 485
|
||||
// (get) Token: 0x06000CCC RID: 3276 RVA: 0x00039B04 File Offset: 0x00037D04
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.dictionary.Count;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000377 RID: 887
|
||||
private Dictionary<TKey, TValue> dictionary;
|
||||
|
||||
/// <summary>Enumerates the elements of a <see cref="T:System.Collections.Generic.Dictionary`2.KeyCollection" />.</summary>
|
||||
// Token: 0x02000103 RID: 259
|
||||
[Serializable]
|
||||
public struct Enumerator : IEnumerator, IDisposable, IEnumerator<TKey>
|
||||
{
|
||||
// Token: 0x06000CCD RID: 3277 RVA: 0x00039B14 File Offset: 0x00037D14
|
||||
internal Enumerator(Dictionary<TKey, TValue> host)
|
||||
{
|
||||
this.host_enumerator = host.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: 0x170001E6 RID: 486
|
||||
// (get) Token: 0x06000CCE RID: 3278 RVA: 0x00039B24 File Offset: 0x00037D24
|
||||
object IEnumerator.Current
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.host_enumerator.CurrentKey;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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: 0x06000CCF RID: 3279 RVA: 0x00039B38 File Offset: 0x00037D38
|
||||
void IEnumerator.Reset()
|
||||
{
|
||||
this.host_enumerator.Reset();
|
||||
}
|
||||
|
||||
/// <summary>Releases all resources used by the <see cref="T:System.Collections.Generic.Dictionary`2.KeyCollection.Enumerator" />.</summary>
|
||||
// Token: 0x06000CD0 RID: 3280 RVA: 0x00039B48 File Offset: 0x00037D48
|
||||
public void Dispose()
|
||||
{
|
||||
this.host_enumerator.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>Advances the enumerator to the next element of the <see cref="T:System.Collections.Generic.Dictionary`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: 0x06000CD1 RID: 3281 RVA: 0x00039B58 File Offset: 0x00037D58
|
||||
public bool MoveNext()
|
||||
{
|
||||
return this.host_enumerator.MoveNext();
|
||||
}
|
||||
|
||||
/// <summary>Gets the element at the current position of the enumerator.</summary>
|
||||
/// <returns>The element in the <see cref="T:System.Collections.Generic.Dictionary`2.KeyCollection" /> at the current position of the enumerator.</returns>
|
||||
// Token: 0x170001E7 RID: 487
|
||||
// (get) Token: 0x06000CD2 RID: 3282 RVA: 0x00039B68 File Offset: 0x00037D68
|
||||
public TKey Current
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.host_enumerator.current.Key;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000378 RID: 888
|
||||
private Dictionary<TKey, TValue>.Enumerator host_enumerator;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Represents the collection of values in a <see cref="T:System.Collections.Generic.Dictionary`2" />. This class cannot be inherited. </summary>
|
||||
// Token: 0x02000104 RID: 260
|
||||
[DebuggerTypeProxy(typeof(CollectionDebuggerView<, >))]
|
||||
[DebuggerDisplay("Count={Count}")]
|
||||
[Serializable]
|
||||
public sealed class ValueCollection : IEnumerable, ICollection, ICollection<TValue>, IEnumerable<TValue>
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Dictionary`2.ValueCollection" /> class that reflects the values in the specified <see cref="T:System.Collections.Generic.Dictionary`2" />.</summary>
|
||||
/// <param name="dictionary">The <see cref="T:System.Collections.Generic.Dictionary`2" /> whose values are reflected in the new <see cref="T:System.Collections.Generic.Dictionary`2.ValueCollection" />.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="dictionary" /> is null.</exception>
|
||||
// Token: 0x06000CD3 RID: 3283 RVA: 0x00039B7C File Offset: 0x00037D7C
|
||||
public ValueCollection(Dictionary<TKey, TValue> dictionary)
|
||||
{
|
||||
if (dictionary == null)
|
||||
{
|
||||
throw new ArgumentNullException("dictionary");
|
||||
}
|
||||
this.dictionary = dictionary;
|
||||
}
|
||||
|
||||
// Token: 0x06000CD4 RID: 3284 RVA: 0x00039B9C File Offset: 0x00037D9C
|
||||
void ICollection<TValue>.Add(TValue item)
|
||||
{
|
||||
throw new NotSupportedException("this is a read-only collection");
|
||||
}
|
||||
|
||||
// Token: 0x06000CD5 RID: 3285 RVA: 0x00039BA8 File Offset: 0x00037DA8
|
||||
void ICollection<TValue>.Clear()
|
||||
{
|
||||
throw new NotSupportedException("this is a read-only collection");
|
||||
}
|
||||
|
||||
// Token: 0x06000CD6 RID: 3286 RVA: 0x00039BB4 File Offset: 0x00037DB4
|
||||
bool ICollection<TValue>.Contains(TValue item)
|
||||
{
|
||||
return this.dictionary.ContainsValue(item);
|
||||
}
|
||||
|
||||
// Token: 0x06000CD7 RID: 3287 RVA: 0x00039BC4 File Offset: 0x00037DC4
|
||||
bool ICollection<TValue>.Remove(TValue item)
|
||||
{
|
||||
throw new NotSupportedException("this is a read-only collection");
|
||||
}
|
||||
|
||||
// Token: 0x06000CD8 RID: 3288 RVA: 0x00039BD0 File Offset: 0x00037DD0
|
||||
IEnumerator<TValue> IEnumerable<TValue>.GetEnumerator()
|
||||
{
|
||||
return this.GetEnumerator();
|
||||
}
|
||||
|
||||
/// <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: 0x06000CD9 RID: 3289 RVA: 0x00039BE0 File Offset: 0x00037DE0
|
||||
void ICollection.CopyTo(Array array, int index)
|
||||
{
|
||||
TValue[] array2 = array as TValue[];
|
||||
if (array2 != null)
|
||||
{
|
||||
this.CopyTo(array2, index);
|
||||
return;
|
||||
}
|
||||
this.dictionary.CopyToCheck(array, index);
|
||||
this.dictionary.Do_ICollectionCopyTo<TValue>(array, index, new Dictionary<TKey, TValue>.Transform<TValue>(Dictionary<TKey, TValue>.pick_value));
|
||||
}
|
||||
|
||||
/// <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: 0x06000CDA RID: 3290 RVA: 0x00039C2C File Offset: 0x00037E2C
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return this.GetEnumerator();
|
||||
}
|
||||
|
||||
// Token: 0x170001E8 RID: 488
|
||||
// (get) Token: 0x06000CDB RID: 3291 RVA: 0x00039C3C File Offset: 0x00037E3C
|
||||
bool ICollection<TValue>.IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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.Dictionary`2.ValueCollection" />, this property always returns false.</returns>
|
||||
// Token: 0x170001E9 RID: 489
|
||||
// (get) Token: 0x06000CDC RID: 3292 RVA: 0x00039C40 File Offset: 0x00037E40
|
||||
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.Dictionary`2.ValueCollection" />, this property always returns the current instance.</returns>
|
||||
// Token: 0x170001EA RID: 490
|
||||
// (get) Token: 0x06000CDD RID: 3293 RVA: 0x00039C44 File Offset: 0x00037E44
|
||||
object ICollection.SyncRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((ICollection)this.dictionary).SyncRoot;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Copies the <see cref="T:System.Collections.Generic.Dictionary`2.ValueCollection" /> 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.Dictionary`2.ValueCollection" />. 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.Dictionary`2.ValueCollection" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.</exception>
|
||||
// Token: 0x06000CDE RID: 3294 RVA: 0x00039C54 File Offset: 0x00037E54
|
||||
public void CopyTo(TValue[] array, int index)
|
||||
{
|
||||
this.dictionary.CopyToCheck(array, index);
|
||||
this.dictionary.Do_CopyTo<TValue, TValue>(array, index, new Dictionary<TKey, TValue>.Transform<TValue>(Dictionary<TKey, TValue>.pick_value));
|
||||
}
|
||||
|
||||
/// <summary>Returns an enumerator that iterates through the <see cref="T:System.Collections.Generic.Dictionary`2.ValueCollection" />.</summary>
|
||||
/// <returns>A <see cref="T:System.Collections.Generic.Dictionary`2.ValueCollection.Enumerator" /> for the <see cref="T:System.Collections.Generic.Dictionary`2.ValueCollection" />.</returns>
|
||||
// Token: 0x06000CDF RID: 3295 RVA: 0x00039C88 File Offset: 0x00037E88
|
||||
public Dictionary<TKey, TValue>.ValueCollection.Enumerator GetEnumerator()
|
||||
{
|
||||
return new Dictionary<TKey, TValue>.ValueCollection.Enumerator(this.dictionary);
|
||||
}
|
||||
|
||||
/// <summary>Gets the number of elements contained in the <see cref="T:System.Collections.Generic.Dictionary`2.ValueCollection" />.</summary>
|
||||
/// <returns>The number of elements contained in the <see cref="T:System.Collections.Generic.Dictionary`2.ValueCollection" />.</returns>
|
||||
// Token: 0x170001EB RID: 491
|
||||
// (get) Token: 0x06000CE0 RID: 3296 RVA: 0x00039C98 File Offset: 0x00037E98
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.dictionary.Count;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000379 RID: 889
|
||||
private Dictionary<TKey, TValue> dictionary;
|
||||
|
||||
/// <summary>Enumerates the elements of a <see cref="T:System.Collections.Generic.Dictionary`2.ValueCollection" />.</summary>
|
||||
// Token: 0x02000105 RID: 261
|
||||
[Serializable]
|
||||
public struct Enumerator : IEnumerator, IDisposable, IEnumerator<TValue>
|
||||
{
|
||||
// Token: 0x06000CE1 RID: 3297 RVA: 0x00039CA8 File Offset: 0x00037EA8
|
||||
internal Enumerator(Dictionary<TKey, TValue> host)
|
||||
{
|
||||
this.host_enumerator = host.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: 0x170001EC RID: 492
|
||||
// (get) Token: 0x06000CE2 RID: 3298 RVA: 0x00039CB8 File Offset: 0x00037EB8
|
||||
object IEnumerator.Current
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.host_enumerator.CurrentValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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: 0x06000CE3 RID: 3299 RVA: 0x00039CCC File Offset: 0x00037ECC
|
||||
void IEnumerator.Reset()
|
||||
{
|
||||
this.host_enumerator.Reset();
|
||||
}
|
||||
|
||||
/// <summary>Releases all resources used by the <see cref="T:System.Collections.Generic.Dictionary`2.ValueCollection.Enumerator" />.</summary>
|
||||
// Token: 0x06000CE4 RID: 3300 RVA: 0x00039CDC File Offset: 0x00037EDC
|
||||
public void Dispose()
|
||||
{
|
||||
this.host_enumerator.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>Advances the enumerator to the next element of the <see cref="T:System.Collections.Generic.Dictionary`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: 0x06000CE5 RID: 3301 RVA: 0x00039CEC File Offset: 0x00037EEC
|
||||
public bool MoveNext()
|
||||
{
|
||||
return this.host_enumerator.MoveNext();
|
||||
}
|
||||
|
||||
/// <summary>Gets the element at the current position of the enumerator.</summary>
|
||||
/// <returns>The element in the <see cref="T:System.Collections.Generic.Dictionary`2.ValueCollection" /> at the current position of the enumerator.</returns>
|
||||
// Token: 0x170001ED RID: 493
|
||||
// (get) Token: 0x06000CE6 RID: 3302 RVA: 0x00039CFC File Offset: 0x00037EFC
|
||||
public TValue Current
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.host_enumerator.current.Value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400037A RID: 890
|
||||
private Dictionary<TKey, TValue>.Enumerator host_enumerator;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x020006C6 RID: 1734
|
||||
// (Invoke) Token: 0x060041A0 RID: 16800
|
||||
private delegate TRet Transform<TRet>(TKey key, TValue value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
using System;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
/// <summary>Provides a base class for implementations of the <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> generic interface.</summary>
|
||||
/// <typeparam name="T">The type of objects to compare.</typeparam>
|
||||
// Token: 0x02000106 RID: 262
|
||||
[Serializable]
|
||||
public abstract class EqualityComparer<T> : IEqualityComparer<T>, IEqualityComparer
|
||||
{
|
||||
// Token: 0x06000CE8 RID: 3304 RVA: 0x00039D18 File Offset: 0x00037F18
|
||||
static EqualityComparer()
|
||||
{
|
||||
if (typeof(IEquatable<T>).IsAssignableFrom(typeof(T)))
|
||||
{
|
||||
EqualityComparer<T>._default = (EqualityComparer<T>)Activator.CreateInstance(typeof(GenericEqualityComparer<>).MakeGenericType(new Type[] { typeof(T) }));
|
||||
}
|
||||
else
|
||||
{
|
||||
EqualityComparer<T>._default = new EqualityComparer<T>.DefaultComparer();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Returns a hash code for the specified object.</summary>
|
||||
/// <returns>A hash code for the specified object.</returns>
|
||||
/// <param name="obj">The <see cref="T:System.Object" /> for which a hash code is to be returned.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The type of <paramref name="obj" /> is a reference type and <paramref name="obj" /> is null.-or-<paramref name="obj" /> is of a type that cannot be cast to type <paramref name="T" />.</exception>
|
||||
// Token: 0x06000CE9 RID: 3305 RVA: 0x00039D84 File Offset: 0x00037F84
|
||||
int IEqualityComparer.GetHashCode(object obj)
|
||||
{
|
||||
return this.GetHashCode((T)((object)obj));
|
||||
}
|
||||
|
||||
/// <summary>Determines whether the specified objects are equal.</summary>
|
||||
/// <returns>true if the specified objects are equal; otherwise, false.</returns>
|
||||
/// <param name="x">The first object to compare.</param>
|
||||
/// <param name="y">The second object to compare.</param>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="x" /> or <paramref name="y" /> is of a type that cannot be cast to type <paramref name="T" />.</exception>
|
||||
// Token: 0x06000CEA RID: 3306 RVA: 0x00039D94 File Offset: 0x00037F94
|
||||
bool IEqualityComparer.Equals(object x, object y)
|
||||
{
|
||||
return this.Equals((T)((object)x), (T)((object)y));
|
||||
}
|
||||
|
||||
/// <summary>When overridden in a derived class, serves as a hash function for the specified object for hashing algorithms and data structures, such as a hash table.</summary>
|
||||
/// <returns>A hash code for the specified object.</returns>
|
||||
/// <param name="obj">The object for which to get a hash code.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The type of <paramref name="obj" /> is a reference type and <paramref name="obj" /> is null.</exception>
|
||||
// Token: 0x06000CEB RID: 3307
|
||||
public abstract int GetHashCode(T obj);
|
||||
|
||||
/// <summary>When overridden in a derived class, determines whether two objects of type <paramref name="T" /> are equal.</summary>
|
||||
/// <returns>true if the specified objects are equal; otherwise, false.</returns>
|
||||
/// <param name="x">The first object to compare.</param>
|
||||
/// <param name="y">The second object to compare.</param>
|
||||
// Token: 0x06000CEC RID: 3308
|
||||
public abstract bool Equals(T x, T y);
|
||||
|
||||
/// <summary>Returns a default equality comparer for the type specified by the generic argument.</summary>
|
||||
/// <returns>The default instance of the <see cref="T:System.Collections.Generic.EqualityComparer`1" /> class for type <paramref name="T" />.</returns>
|
||||
// Token: 0x170001EE RID: 494
|
||||
// (get) Token: 0x06000CED RID: 3309 RVA: 0x00039DA8 File Offset: 0x00037FA8
|
||||
public static EqualityComparer<T> Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return EqualityComparer<T>._default;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400037B RID: 891
|
||||
private static readonly EqualityComparer<T> _default;
|
||||
|
||||
// Token: 0x02000107 RID: 263
|
||||
[Serializable]
|
||||
private sealed class DefaultComparer : EqualityComparer<T>
|
||||
{
|
||||
// Token: 0x06000CEF RID: 3311 RVA: 0x00039DB8 File Offset: 0x00037FB8
|
||||
public override int GetHashCode(T obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return obj.GetHashCode();
|
||||
}
|
||||
|
||||
// Token: 0x06000CF0 RID: 3312 RVA: 0x00039DD4 File Offset: 0x00037FD4
|
||||
public override bool Equals(T x, T y)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
return y == null;
|
||||
}
|
||||
return x.Equals(y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
// Token: 0x020000FD RID: 253
|
||||
[Serializable]
|
||||
internal sealed class GenericComparer<T> : Comparer<T> where T : IComparable<T>
|
||||
{
|
||||
// Token: 0x06000C6E RID: 3182 RVA: 0x000385D8 File Offset: 0x000367D8
|
||||
public override int Compare(T x, T y)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
return (y != null) ? (-1) : 0;
|
||||
}
|
||||
if (y == null)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return x.CompareTo(y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
// Token: 0x02000108 RID: 264
|
||||
[Serializable]
|
||||
internal sealed class GenericEqualityComparer<T> : EqualityComparer<T> where T : IEquatable<T>
|
||||
{
|
||||
// Token: 0x06000CF2 RID: 3314 RVA: 0x00039E14 File Offset: 0x00038014
|
||||
public override int GetHashCode(T obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return obj.GetHashCode();
|
||||
}
|
||||
|
||||
// Token: 0x06000CF3 RID: 3315 RVA: 0x00039E30 File Offset: 0x00038030
|
||||
public override bool Equals(T x, T y)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
return y == null;
|
||||
}
|
||||
return x.Equals(y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
/// <summary>Defines methods to manipulate generic collections.</summary>
|
||||
/// <typeparam name="T">The type of the elements in the collection.</typeparam>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x02000030 RID: 48
|
||||
public interface ICollection<T> : IEnumerable, IEnumerable<T>
|
||||
{
|
||||
/// <summary>Gets the number of elements contained in the <see cref="T:System.Collections.Generic.ICollection`1" />.</summary>
|
||||
/// <returns>The number of elements contained in the <see cref="T:System.Collections.Generic.ICollection`1" />.</returns>
|
||||
// Token: 0x17000026 RID: 38
|
||||
// (get) Token: 0x060004B2 RID: 1202
|
||||
int Count { get; }
|
||||
|
||||
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.Generic.ICollection`1" /> is read-only.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Collections.Generic.ICollection`1" /> is read-only; otherwise, false.</returns>
|
||||
// Token: 0x17000027 RID: 39
|
||||
// (get) Token: 0x060004B3 RID: 1203
|
||||
bool IsReadOnly { get; }
|
||||
|
||||
/// <summary>Adds an item to the <see cref="T:System.Collections.Generic.ICollection`1" />.</summary>
|
||||
/// <param name="item">The object to add to the <see cref="T:System.Collections.Generic.ICollection`1" />.</param>
|
||||
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1" /> is read-only.</exception>
|
||||
// Token: 0x060004B4 RID: 1204
|
||||
void Add(T item);
|
||||
|
||||
/// <summary>Removes all items from the <see cref="T:System.Collections.Generic.ICollection`1" />.</summary>
|
||||
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1" /> is read-only. </exception>
|
||||
// Token: 0x060004B5 RID: 1205
|
||||
void Clear();
|
||||
|
||||
/// <summary>Determines whether the <see cref="T:System.Collections.Generic.ICollection`1" /> contains a specific value.</summary>
|
||||
/// <returns>true if <paramref name="item" /> is found in the <see cref="T:System.Collections.Generic.ICollection`1" />; otherwise, false.</returns>
|
||||
/// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.ICollection`1" />.</param>
|
||||
// Token: 0x060004B6 RID: 1206
|
||||
bool Contains(T item);
|
||||
|
||||
/// <summary>Copies the elements of the <see cref="T:System.Collections.Generic.ICollection`1" /> 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.Generic.ICollection`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 0.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The number of elements in the source <see cref="T:System.Collections.Generic.ICollection`1" /> is greater than the available space from <paramref name="arrayIndex" /> to the end of the destination <paramref name="array" />.</exception>
|
||||
// Token: 0x060004B7 RID: 1207
|
||||
void CopyTo(T[] array, int arrayIndex);
|
||||
|
||||
/// <summary>Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Generic.ICollection`1" />.</summary>
|
||||
/// <returns>true if <paramref name="item" /> was successfully removed from the <see cref="T:System.Collections.Generic.ICollection`1" />; otherwise, false. This method also returns false if <paramref name="item" /> is not found in the original <see cref="T:System.Collections.Generic.ICollection`1" />.</returns>
|
||||
/// <param name="item">The object to remove from the <see cref="T:System.Collections.Generic.ICollection`1" />.</param>
|
||||
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1" /> is read-only.</exception>
|
||||
// Token: 0x060004B8 RID: 1208
|
||||
bool Remove(T item);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
/// <summary>Defines a method that a type implements to compare two objects.</summary>
|
||||
/// <typeparam name="T">The type of objects to compare.</typeparam>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x02000109 RID: 265
|
||||
public interface IComparer<T>
|
||||
{
|
||||
/// <summary>Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.</summary>
|
||||
/// <returns>Value Condition Less than zero<paramref name="x" /> is less than <paramref name="y" />.Zero<paramref name="x" /> equals <paramref name="y" />.Greater than zero<paramref name="x" /> is greater than <paramref name="y" />.</returns>
|
||||
/// <param name="x">The first object to compare.</param>
|
||||
/// <param name="y">The second object to compare.</param>
|
||||
// Token: 0x06000CF4 RID: 3316
|
||||
int Compare(T x, T y);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
/// <summary>Represents a generic collection of key/value pairs.</summary>
|
||||
/// <typeparam name="TKey">The type of keys in the dictionary.</typeparam>
|
||||
/// <typeparam name="TValue">The type of values in the dictionary.</typeparam>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0200010A RID: 266
|
||||
public interface IDictionary<TKey, TValue> : IEnumerable, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>
|
||||
{
|
||||
/// <summary>Adds an element with the provided key and value to the <see cref="T:System.Collections.Generic.IDictionary`2" />.</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">An element with the same key already exists in the <see cref="T:System.Collections.Generic.IDictionary`2" />.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.IDictionary`2" /> is read-only.</exception>
|
||||
// Token: 0x06000CF5 RID: 3317
|
||||
void Add(TKey key, TValue value);
|
||||
|
||||
/// <summary>Determines whether the <see cref="T:System.Collections.Generic.IDictionary`2" /> contains an element with the specified key.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Collections.Generic.IDictionary`2" /> contains an element with the key; otherwise, false.</returns>
|
||||
/// <param name="key">The key to locate in the <see cref="T:System.Collections.Generic.IDictionary`2" />.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="key" /> is null.</exception>
|
||||
// Token: 0x06000CF6 RID: 3318
|
||||
bool ContainsKey(TKey key);
|
||||
|
||||
/// <summary>Removes the element with the specified key from the <see cref="T:System.Collections.Generic.IDictionary`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.IDictionary`2" />.</returns>
|
||||
/// <param name="key">The key of the element to remove.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="key" /> is null.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.IDictionary`2" /> is read-only.</exception>
|
||||
// Token: 0x06000CF7 RID: 3319
|
||||
bool Remove(TKey key);
|
||||
|
||||
/// <summary>Gets the value associated with the specified key.</summary>
|
||||
/// <returns>true if the object that implements <see cref="T:System.Collections.Generic.IDictionary`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: 0x06000CF8 RID: 3320
|
||||
bool TryGetValue(TKey key, out TValue value);
|
||||
|
||||
/// <summary>Gets or sets the element with the specified key.</summary>
|
||||
/// <returns>The element with the specified key.</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.Collections.Generic.KeyNotFoundException">The property is retrieved and <paramref name="key" /> is not found.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">The property is set and the <see cref="T:System.Collections.Generic.IDictionary`2" /> is read-only.</exception>
|
||||
// Token: 0x170001EF RID: 495
|
||||
TValue this[TKey key] { get; set; }
|
||||
|
||||
/// <summary>Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the <see cref="T:System.Collections.Generic.IDictionary`2" />.</summary>
|
||||
/// <returns>An <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the object that implements <see cref="T:System.Collections.Generic.IDictionary`2" />.</returns>
|
||||
// Token: 0x170001F0 RID: 496
|
||||
// (get) Token: 0x06000CFB RID: 3323
|
||||
ICollection<TKey> Keys { get; }
|
||||
|
||||
/// <summary>Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the values in the <see cref="T:System.Collections.Generic.IDictionary`2" />.</summary>
|
||||
/// <returns>An <see cref="T:System.Collections.Generic.ICollection`1" /> containing the values in the object that implements <see cref="T:System.Collections.Generic.IDictionary`2" />.</returns>
|
||||
// Token: 0x170001F1 RID: 497
|
||||
// (get) Token: 0x06000CFC RID: 3324
|
||||
ICollection<TValue> Values { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
/// <summary>Exposes the enumerator, which supports a simple iteration over a collection of a specified type.</summary>
|
||||
/// <typeparam name="T">The type of objects to enumerate.</typeparam>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0200001E RID: 30
|
||||
public interface IEnumerable<T> : IEnumerable
|
||||
{
|
||||
/// <summary>Returns an enumerator that iterates through the collection.</summary>
|
||||
/// <returns>A <see cref="T:System.Collections.Generic.IEnumerator`1" /> that can be used to iterate through the collection.</returns>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0600027C RID: 636
|
||||
IEnumerator<T> GetEnumerator();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
/// <summary>Supports a simple iteration over a generic collection.</summary>
|
||||
/// <typeparam name="T">The type of objects to enumerate.</typeparam>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0200001A RID: 26
|
||||
public interface IEnumerator<T> : IEnumerator, IDisposable
|
||||
{
|
||||
/// <summary>Gets the element in the collection at the current position of the enumerator.</summary>
|
||||
/// <returns>The element in the collection at the current position of the enumerator.</returns>
|
||||
// Token: 0x17000008 RID: 8
|
||||
// (get) Token: 0x06000174 RID: 372
|
||||
T Current { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
/// <summary>Defines methods to support the comparison of objects for equality.</summary>
|
||||
/// <typeparam name="T">The type of objects to compare.</typeparam>
|
||||
// Token: 0x0200010B RID: 267
|
||||
public interface IEqualityComparer<T>
|
||||
{
|
||||
/// <summary>Determines whether the specified objects are equal.</summary>
|
||||
/// <returns>true if the specified objects are equal; otherwise, false.</returns>
|
||||
/// <param name="x">The first object of type <paramref name="T" /> to compare.</param>
|
||||
/// <param name="y">The second object of type <paramref name="T" /> to compare.</param>
|
||||
// Token: 0x06000CFD RID: 3325
|
||||
bool Equals(T x, T y);
|
||||
|
||||
/// <summary>Returns a hash code for the specified object.</summary>
|
||||
/// <returns>A hash code for the specified object.</returns>
|
||||
/// <param name="obj">The <see cref="T:System.Object" /> for which a hash code is to be returned.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The type of <paramref name="obj" /> is a reference type and <paramref name="obj" /> is null.</exception>
|
||||
// Token: 0x06000CFE RID: 3326
|
||||
int GetHashCode(T obj);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
/// <summary>Represents a collection of objects that can be individually accessed by index.</summary>
|
||||
/// <typeparam name="T">The type of elements in the list.</typeparam>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0200002F RID: 47
|
||||
public interface IList<T> : IEnumerable, ICollection<T>, IEnumerable<T>
|
||||
{
|
||||
/// <summary>Determines the index of a specific item in the <see cref="T:System.Collections.Generic.IList`1" />.</summary>
|
||||
/// <returns>The index of <paramref name="item" /> if found in the list; otherwise, -1.</returns>
|
||||
/// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.IList`1" />.</param>
|
||||
// Token: 0x060004AD RID: 1197
|
||||
int IndexOf(T item);
|
||||
|
||||
/// <summary>Inserts an item to the <see cref="T:System.Collections.Generic.IList`1" /> at the specified index.</summary>
|
||||
/// <param name="index">The zero-based index at which <paramref name="item" /> should be inserted.</param>
|
||||
/// <param name="item">The object to insert into the <see cref="T:System.Collections.Generic.IList`1" />.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="index" /> is not a valid index in the <see cref="T:System.Collections.Generic.IList`1" />.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.IList`1" /> is read-only.</exception>
|
||||
// Token: 0x060004AE RID: 1198
|
||||
void Insert(int index, T item);
|
||||
|
||||
/// <summary>Removes the <see cref="T:System.Collections.Generic.IList`1" /> item at the specified index.</summary>
|
||||
/// <param name="index">The zero-based index of the item to remove.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="index" /> is not a valid index in the <see cref="T:System.Collections.Generic.IList`1" />.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.IList`1" /> is read-only.</exception>
|
||||
// Token: 0x060004AF RID: 1199
|
||||
void RemoveAt(int index);
|
||||
|
||||
/// <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 not a valid index in the <see cref="T:System.Collections.Generic.IList`1" />.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">The property is set and the <see cref="T:System.Collections.Generic.IList`1" /> is read-only.</exception>
|
||||
// Token: 0x17000025 RID: 37
|
||||
T this[int index] { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
/// <summary>The exception that is thrown when the key specified for accessing an element in a collection does not match any key in the collection.</summary>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0200010C RID: 268
|
||||
[ComVisible(true)]
|
||||
[Serializable]
|
||||
public class KeyNotFoundException : SystemException, ISerializable
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.KeyNotFoundException" /> class using default property values.</summary>
|
||||
// Token: 0x06000CFF RID: 3327 RVA: 0x00039E58 File Offset: 0x00038058
|
||||
public KeyNotFoundException()
|
||||
: base("The given key was not present in the dictionary.")
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.KeyNotFoundException" /> class with the specified error message.</summary>
|
||||
/// <param name="message">The message that describes the error.</param>
|
||||
// Token: 0x06000D00 RID: 3328 RVA: 0x00039E68 File Offset: 0x00038068
|
||||
public KeyNotFoundException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.KeyNotFoundException" /> class with the specified error message and a reference to the inner exception that is the cause of this exception.</summary>
|
||||
/// <param name="message">The error message that explains the reason for the exception.</param>
|
||||
/// <param name="innerException">The exception that is the cause of the current exception. If the <paramref name="innerException" /> parameter is not null, the current exception is raised in a catch block that handles the inner exception.</param>
|
||||
// Token: 0x06000D01 RID: 3329 RVA: 0x00039E74 File Offset: 0x00038074
|
||||
public KeyNotFoundException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.KeyNotFoundException" /> class with serialized data.</summary>
|
||||
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
|
||||
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
|
||||
// Token: 0x06000D02 RID: 3330 RVA: 0x00039E80 File Offset: 0x00038080
|
||||
protected KeyNotFoundException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
/// <summary>Defines a key/value pair that can be set or retrieved.</summary>
|
||||
/// <typeparam name="TKey">The type of the key.</typeparam>
|
||||
/// <typeparam name="TValue">The type of the value.</typeparam>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0200010D RID: 269
|
||||
[DebuggerDisplay("{value}", Name = "[{key}]")]
|
||||
[Serializable]
|
||||
public struct KeyValuePair<TKey, TValue>
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.KeyValuePair`2" /> structure with the specified key and value.</summary>
|
||||
/// <param name="key">The object defined in each key/value pair.</param>
|
||||
/// <param name="value">The definition associated with <paramref name="key" />.</param>
|
||||
// Token: 0x06000D03 RID: 3331 RVA: 0x00039E8C File Offset: 0x0003808C
|
||||
public KeyValuePair(TKey key, TValue value)
|
||||
{
|
||||
this.Key = key;
|
||||
this.Value = value;
|
||||
}
|
||||
|
||||
/// <summary>Gets the key in the key/value pair.</summary>
|
||||
/// <returns>A <paramref name="TKey" /> that is the key of the <see cref="T:System.Collections.Generic.KeyValuePair`2" />. </returns>
|
||||
// Token: 0x170001F2 RID: 498
|
||||
// (get) Token: 0x06000D04 RID: 3332 RVA: 0x00039E9C File Offset: 0x0003809C
|
||||
// (set) Token: 0x06000D05 RID: 3333 RVA: 0x00039EA4 File Offset: 0x000380A4
|
||||
public TKey Key
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.key;
|
||||
}
|
||||
private set
|
||||
{
|
||||
this.key = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the value in the key/value pair.</summary>
|
||||
/// <returns>A <paramref name="TValue" /> that is the value of the <see cref="T:System.Collections.Generic.KeyValuePair`2" />. </returns>
|
||||
// Token: 0x170001F3 RID: 499
|
||||
// (get) Token: 0x06000D06 RID: 3334 RVA: 0x00039EB0 File Offset: 0x000380B0
|
||||
// (set) Token: 0x06000D07 RID: 3335 RVA: 0x00039EB8 File Offset: 0x000380B8
|
||||
public TValue Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
private set
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Returns a string representation of the <see cref="T:System.Collections.Generic.KeyValuePair`2" />, using the string representations of the key and value.</summary>
|
||||
/// <returns>A string representation of the <see cref="T:System.Collections.Generic.KeyValuePair`2" />, which includes the string representations of the key and value.</returns>
|
||||
// Token: 0x06000D08 RID: 3336 RVA: 0x00039EC4 File Offset: 0x000380C4
|
||||
public override string ToString()
|
||||
{
|
||||
string[] array = new string[5];
|
||||
array[0] = "[";
|
||||
int num = 1;
|
||||
string text;
|
||||
if (this.Key != null)
|
||||
{
|
||||
TKey tkey = this.Key;
|
||||
text = tkey.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
text = string.Empty;
|
||||
}
|
||||
array[num] = text;
|
||||
array[2] = ", ";
|
||||
int num2 = 3;
|
||||
string text2;
|
||||
if (this.Value != null)
|
||||
{
|
||||
TValue tvalue = this.Value;
|
||||
text2 = tvalue.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
text2 = string.Empty;
|
||||
}
|
||||
array[num2] = text2;
|
||||
array[4] = "]";
|
||||
return string.Concat(array);
|
||||
}
|
||||
|
||||
// Token: 0x0400037C RID: 892
|
||||
private TKey key;
|
||||
|
||||
// Token: 0x0400037D RID: 893
|
||||
private TValue value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
// Token: 0x020000FE RID: 254
|
||||
internal struct Link
|
||||
{
|
||||
// Token: 0x04000360 RID: 864
|
||||
public int HashCode;
|
||||
|
||||
// Token: 0x04000361 RID: 865
|
||||
public int Next;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,1370 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace System.Collections.Generic
|
||||
{
|
||||
/// <summary>Represents a strongly typed list of objects that can be accessed by index. Provides methods to search, sort, and manipulate lists.</summary>
|
||||
/// <typeparam name="T">The type of elements in the list.</typeparam>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0200010E RID: 270
|
||||
[DebuggerTypeProxy(typeof(CollectionDebuggerView<>))]
|
||||
[DebuggerDisplay("Count={Count}")]
|
||||
[Serializable]
|
||||
public class List<T> : IEnumerable, ICollection, IList, ICollection<T>, IEnumerable<T>, IList<T>
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.List`1" /> class that is empty and has the default initial capacity.</summary>
|
||||
// Token: 0x06000D09 RID: 3337 RVA: 0x00039F58 File Offset: 0x00038158
|
||||
public List()
|
||||
{
|
||||
this._items = List<T>.EmptyArray;
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.List`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 list.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="collection" /> is null.</exception>
|
||||
// Token: 0x06000D0A RID: 3338 RVA: 0x00039F6C File Offset: 0x0003816C
|
||||
public List(IEnumerable<T> collection)
|
||||
{
|
||||
this.CheckCollection(collection);
|
||||
ICollection<T> collection2 = collection as ICollection<T>;
|
||||
if (collection2 == null)
|
||||
{
|
||||
this._items = List<T>.EmptyArray;
|
||||
this.AddEnumerable(collection);
|
||||
}
|
||||
else
|
||||
{
|
||||
this._items = new T[collection2.Count];
|
||||
this.AddCollection(collection2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.List`1" /> class that is empty and has the specified initial capacity.</summary>
|
||||
/// <param name="capacity">The number of elements that the new list can initially store.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="capacity" /> is less than 0. </exception>
|
||||
// Token: 0x06000D0B RID: 3339 RVA: 0x00039FC4 File Offset: 0x000381C4
|
||||
public List(int capacity)
|
||||
{
|
||||
if (capacity < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("capacity");
|
||||
}
|
||||
this._items = new T[capacity];
|
||||
}
|
||||
|
||||
// Token: 0x06000D0C RID: 3340 RVA: 0x00039FF8 File Offset: 0x000381F8
|
||||
internal List(T[] data, int size)
|
||||
{
|
||||
this._items = data;
|
||||
this._size = size;
|
||||
}
|
||||
|
||||
// Token: 0x06000D0E RID: 3342 RVA: 0x0003A020 File Offset: 0x00038220
|
||||
IEnumerator<T> IEnumerable<T>.GetEnumerator()
|
||||
{
|
||||
return this.GetEnumerator();
|
||||
}
|
||||
|
||||
/// <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 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="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: 0x06000D0F RID: 3343 RVA: 0x0003A030 File Offset: 0x00038230
|
||||
void ICollection.CopyTo(Array array, int arrayIndex)
|
||||
{
|
||||
Array.Copy(this._items, 0, array, arrayIndex, this._size);
|
||||
}
|
||||
|
||||
/// <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: 0x06000D10 RID: 3344 RVA: 0x0003A048 File Offset: 0x00038248
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return this.GetEnumerator();
|
||||
}
|
||||
|
||||
/// <summary>Adds an item to the <see cref="T:System.Collections.IList" />.</summary>
|
||||
/// <returns>The position into which the new element was inserted.</returns>
|
||||
/// <param name="item">The <see cref="T:System.Object" /> to add to the <see cref="T:System.Collections.IList" />.</param>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="item" /> is of a type that is not assignable to the <see cref="T:System.Collections.IList" />.</exception>
|
||||
// Token: 0x06000D11 RID: 3345 RVA: 0x0003A058 File Offset: 0x00038258
|
||||
int IList.Add(object item)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Add((T)((object)item));
|
||||
return this._size - 1;
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
}
|
||||
throw new ArgumentException("item");
|
||||
}
|
||||
|
||||
/// <summary>Determines whether the <see cref="T:System.Collections.IList" /> contains a specific value.</summary>
|
||||
/// <returns>true if <paramref name="item" /> is found in the <see cref="T:System.Collections.IList" />; otherwise, false.</returns>
|
||||
/// <param name="item">The <see cref="T:System.Object" /> to locate in the <see cref="T:System.Collections.IList" />.</param>
|
||||
// Token: 0x06000D12 RID: 3346 RVA: 0x0003A0D0 File Offset: 0x000382D0
|
||||
bool IList.Contains(object item)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this.Contains((T)((object)item));
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>Determines the index of a specific item in the <see cref="T:System.Collections.IList" />.</summary>
|
||||
/// <returns>The index of <paramref name="item" /> if found in the list; otherwise, –1.</returns>
|
||||
/// <param name="item">The object to locate in the <see cref="T:System.Collections.IList" />.</param>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="item" /> is of a type that is not assignable to the <see cref="T:System.Collections.IList" />.</exception>
|
||||
// Token: 0x06000D13 RID: 3347 RVA: 0x0003A138 File Offset: 0x00038338
|
||||
int IList.IndexOf(object item)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this.IndexOf((T)((object)item));
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// <summary>Inserts an item to the <see cref="T:System.Collections.IList" /> at the specified index.</summary>
|
||||
/// <param name="index">The zero-based index at which <paramref name="item" /> should be inserted.</param>
|
||||
/// <param name="item">The object to insert into the <see cref="T:System.Collections.IList" />.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="index" /> is not a valid index in the <see cref="T:System.Collections.IList" />. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="item" /> is of a type that is not assignable to the <see cref="T:System.Collections.IList" />.</exception>
|
||||
// Token: 0x06000D14 RID: 3348 RVA: 0x0003A1A0 File Offset: 0x000383A0
|
||||
void IList.Insert(int index, object item)
|
||||
{
|
||||
this.CheckIndex(index);
|
||||
try
|
||||
{
|
||||
this.Insert(index, (T)((object)item));
|
||||
return;
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
}
|
||||
throw new ArgumentException("item");
|
||||
}
|
||||
|
||||
/// <summary>Removes the first occurrence of a specific object from the <see cref="T:System.Collections.IList" />.</summary>
|
||||
/// <param name="item">The object to remove from the <see cref="T:System.Collections.IList" />.</param>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="item" /> is of a type that is not assignable to the <see cref="T:System.Collections.IList" />.</exception>
|
||||
// Token: 0x06000D15 RID: 3349 RVA: 0x0003A218 File Offset: 0x00038418
|
||||
void IList.Remove(object item)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Remove((T)((object)item));
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170001F4 RID: 500
|
||||
// (get) Token: 0x06000D16 RID: 3350 RVA: 0x0003A27C File Offset: 0x0003847C
|
||||
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.List`1" />, this property always returns false.</returns>
|
||||
// Token: 0x170001F5 RID: 501
|
||||
// (get) Token: 0x06000D17 RID: 3351 RVA: 0x0003A280 File Offset: 0x00038480
|
||||
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.List`1" />, this property always returns the current instance.</returns>
|
||||
// Token: 0x170001F6 RID: 502
|
||||
// (get) Token: 0x06000D18 RID: 3352 RVA: 0x0003A284 File Offset: 0x00038484
|
||||
object ICollection.SyncRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.IList" /> has a fixed size.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Collections.IList" /> has a fixed size; otherwise, false. In the default implementation of <see cref="T:System.Collections.Generic.List`1" />, this property always returns false.</returns>
|
||||
// Token: 0x170001F7 RID: 503
|
||||
// (get) Token: 0x06000D19 RID: 3353 RVA: 0x0003A288 File Offset: 0x00038488
|
||||
bool IList.IsFixedSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.IList" /> is read-only.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Collections.IList" /> is read-only; otherwise, false. In the default implementation of <see cref="T:System.Collections.Generic.List`1" />, this property always returns false.</returns>
|
||||
// Token: 0x170001F8 RID: 504
|
||||
// (get) Token: 0x06000D1A RID: 3354 RVA: 0x0003A28C File Offset: 0x0003848C
|
||||
bool IList.IsReadOnly
|
||||
{
|
||||
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 not a valid index in the <see cref="T:System.Collections.IList" />.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The property is set and <paramref name="value" /> is of a type that is not assignable to the <see cref="T:System.Collections.IList" />.</exception>
|
||||
// Token: 0x170001F9 RID: 505
|
||||
object IList.this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return this[index];
|
||||
}
|
||||
set
|
||||
{
|
||||
try
|
||||
{
|
||||
this[index] = (T)((object)value);
|
||||
return;
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
}
|
||||
throw new ArgumentException("value");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Adds an object to the end of the <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
/// <param name="item">The object to be added to the end of the <see cref="T:System.Collections.Generic.List`1" />. The value can be null for reference types.</param>
|
||||
// Token: 0x06000D1D RID: 3357 RVA: 0x0003A310 File Offset: 0x00038510
|
||||
public void Add(T item)
|
||||
{
|
||||
if (this._size == this._items.Length)
|
||||
{
|
||||
this.GrowIfNeeded(1);
|
||||
}
|
||||
this._items[this._size++] = item;
|
||||
this._version++;
|
||||
}
|
||||
|
||||
// Token: 0x06000D1E RID: 3358 RVA: 0x0003A364 File Offset: 0x00038564
|
||||
private void GrowIfNeeded(int newCount)
|
||||
{
|
||||
int num = this._size + newCount;
|
||||
if (num > this._items.Length)
|
||||
{
|
||||
this.Capacity = Math.Max(Math.Max(this.Capacity * 2, 4), num);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000D1F RID: 3359 RVA: 0x0003A3A4 File Offset: 0x000385A4
|
||||
private void CheckRange(int idx, int count)
|
||||
{
|
||||
if (idx < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("index");
|
||||
}
|
||||
if (count < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("count");
|
||||
}
|
||||
if (idx + count > this._size)
|
||||
{
|
||||
throw new ArgumentException("index and count exceed length of list");
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000D20 RID: 3360 RVA: 0x0003A3E4 File Offset: 0x000385E4
|
||||
private void AddCollection(ICollection<T> collection)
|
||||
{
|
||||
int count = collection.Count;
|
||||
if (count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.GrowIfNeeded(count);
|
||||
collection.CopyTo(this._items, this._size);
|
||||
this._size += count;
|
||||
}
|
||||
|
||||
// Token: 0x06000D21 RID: 3361 RVA: 0x0003A428 File Offset: 0x00038628
|
||||
private void AddEnumerable(IEnumerable<T> enumerable)
|
||||
{
|
||||
foreach (T t in enumerable)
|
||||
{
|
||||
this.Add(t);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Adds the elements of the specified collection to the end of the <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
/// <param name="collection">The collection whose elements should be added to the end of the <see cref="T:System.Collections.Generic.List`1" />. The collection itself cannot be null, but it can contain elements that are null, if type <paramref name="T" /> is a reference type.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="collection" /> is null.</exception>
|
||||
// Token: 0x06000D22 RID: 3362 RVA: 0x0003A488 File Offset: 0x00038688
|
||||
public void AddRange(IEnumerable<T> collection)
|
||||
{
|
||||
this.CheckCollection(collection);
|
||||
ICollection<T> collection2 = collection as ICollection<T>;
|
||||
if (collection2 != null)
|
||||
{
|
||||
this.AddCollection(collection2);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.AddEnumerable(collection);
|
||||
}
|
||||
this._version++;
|
||||
}
|
||||
|
||||
/// <summary>Returns a read-only <see cref="T:System.Collections.Generic.IList`1" /> wrapper for the current collection.</summary>
|
||||
/// <returns>A <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" /> that acts as a read-only wrapper around the current <see cref="T:System.Collections.Generic.List`1" />.</returns>
|
||||
// Token: 0x06000D23 RID: 3363 RVA: 0x0003A4CC File Offset: 0x000386CC
|
||||
public ReadOnlyCollection<T> AsReadOnly()
|
||||
{
|
||||
return new ReadOnlyCollection<T>(this);
|
||||
}
|
||||
|
||||
/// <summary>Searches the entire sorted <see cref="T:System.Collections.Generic.List`1" /> for an element using the default comparer and returns the zero-based index of the element.</summary>
|
||||
/// <returns>The zero-based index of <paramref name="item" /> in the sorted <see cref="T:System.Collections.Generic.List`1" />, if <paramref name="item" /> is found; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than <paramref name="item" /> or, if there is no larger element, the bitwise complement of <see cref="P:System.Collections.Generic.List`1.Count" />.</returns>
|
||||
/// <param name="item">The object to locate. The value can be null for reference types.</param>
|
||||
/// <exception cref="T:System.InvalidOperationException">The default comparer <see cref="P:System.Collections.Generic.Comparer`1.Default" /> cannot find an implementation of the <see cref="T:System.IComparable`1" /> generic interface or the <see cref="T:System.IComparable" /> interface for type <paramref name="T" />.</exception>
|
||||
// Token: 0x06000D24 RID: 3364 RVA: 0x0003A4D4 File Offset: 0x000386D4
|
||||
public int BinarySearch(T item)
|
||||
{
|
||||
return Array.BinarySearch<T>(this._items, 0, this._size, item);
|
||||
}
|
||||
|
||||
/// <summary>Searches the entire sorted <see cref="T:System.Collections.Generic.List`1" /> for an element using the specified comparer and returns the zero-based index of the element.</summary>
|
||||
/// <returns>The zero-based index of <paramref name="item" /> in the sorted <see cref="T:System.Collections.Generic.List`1" />, if <paramref name="item" /> is found; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than <paramref name="item" /> or, if there is no larger element, the bitwise complement of <see cref="P:System.Collections.Generic.List`1.Count" />.</returns>
|
||||
/// <param name="item">The object to locate. The value can be null for reference types.</param>
|
||||
/// <param name="comparer">The <see cref="T:System.Collections.Generic.IComparer`1" /> implementation to use when comparing elements.-or-null to use the default comparer <see cref="P:System.Collections.Generic.Comparer`1.Default" />.</param>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <paramref name="comparer" /> is null, and the default comparer <see cref="P:System.Collections.Generic.Comparer`1.Default" /> cannot find an implementation of the <see cref="T:System.IComparable`1" /> generic interface or the <see cref="T:System.IComparable" /> interface for type <paramref name="T" />.</exception>
|
||||
// Token: 0x06000D25 RID: 3365 RVA: 0x0003A4EC File Offset: 0x000386EC
|
||||
public int BinarySearch(T item, IComparer<T> comparer)
|
||||
{
|
||||
return Array.BinarySearch<T>(this._items, 0, this._size, item, comparer);
|
||||
}
|
||||
|
||||
/// <summary>Searches a range of elements in the sorted <see cref="T:System.Collections.Generic.List`1" /> for an element using the specified comparer and returns the zero-based index of the element.</summary>
|
||||
/// <returns>The zero-based index of <paramref name="item" /> in the sorted <see cref="T:System.Collections.Generic.List`1" />, if <paramref name="item" /> is found; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than <paramref name="item" /> or, if there is no larger element, the bitwise complement of <see cref="P:System.Collections.Generic.List`1.Count" />.</returns>
|
||||
/// <param name="index">The zero-based starting index of the range to search.</param>
|
||||
/// <param name="count">The length of the range to search.</param>
|
||||
/// <param name="item">The object to locate. The value can be null for reference types.</param>
|
||||
/// <param name="comparer">The <see cref="T:System.Collections.Generic.IComparer`1" /> implementation to use when comparing elements, or null to use the default comparer <see cref="P:System.Collections.Generic.Comparer`1.Default" />.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="index" /> is less than 0.-or-<paramref name="count" /> is less than 0. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="index" /> and <paramref name="count" /> do not denote a valid range in the <see cref="T:System.Collections.Generic.List`1" />.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <paramref name="comparer" /> is null, and the default comparer <see cref="P:System.Collections.Generic.Comparer`1.Default" /> cannot find an implementation of the <see cref="T:System.IComparable`1" /> generic interface or the <see cref="T:System.IComparable" /> interface for type <paramref name="T" />.</exception>
|
||||
// Token: 0x06000D26 RID: 3366 RVA: 0x0003A504 File Offset: 0x00038704
|
||||
public int BinarySearch(int index, int count, T item, IComparer<T> comparer)
|
||||
{
|
||||
this.CheckRange(index, count);
|
||||
return Array.BinarySearch<T>(this._items, index, count, item, comparer);
|
||||
}
|
||||
|
||||
/// <summary>Removes all elements from the <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
// Token: 0x06000D27 RID: 3367 RVA: 0x0003A52C File Offset: 0x0003872C
|
||||
public void Clear()
|
||||
{
|
||||
Array.Clear(this._items, 0, this._items.Length);
|
||||
this._size = 0;
|
||||
this._version++;
|
||||
}
|
||||
|
||||
/// <summary>Determines whether an element is in the <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
/// <returns>true if <paramref name="item" /> is found in the <see cref="T:System.Collections.Generic.List`1" />; otherwise, false.</returns>
|
||||
/// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.List`1" />. The value can be null for reference types.</param>
|
||||
// Token: 0x06000D28 RID: 3368 RVA: 0x0003A558 File Offset: 0x00038758
|
||||
public bool Contains(T item)
|
||||
{
|
||||
return Array.IndexOf<T>(this._items, item, 0, this._size) != -1;
|
||||
}
|
||||
|
||||
/// <summary>Converts the elements in the current <see cref="T:System.Collections.Generic.List`1" /> to another type, and returns a list containing the converted elements.</summary>
|
||||
/// <returns>A <see cref="T:System.Collections.Generic.List`1" /> of the target type containing the converted elements from the current <see cref="T:System.Collections.Generic.List`1" />.</returns>
|
||||
/// <param name="converter">A <see cref="T:System.Converter`2" /> delegate that converts each element from one type to another type.</param>
|
||||
/// <typeparam name="TOutput">The type of the elements of the target array.</typeparam>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="converter" /> is null.</exception>
|
||||
// Token: 0x06000D29 RID: 3369 RVA: 0x0003A574 File Offset: 0x00038774
|
||||
public List<TOutput> ConvertAll<TOutput>(Converter<T, TOutput> converter)
|
||||
{
|
||||
if (converter == null)
|
||||
{
|
||||
throw new ArgumentNullException("converter");
|
||||
}
|
||||
List<TOutput> list = new List<TOutput>(this._size);
|
||||
for (int i = 0; i < this._size; i++)
|
||||
{
|
||||
list._items[i] = converter(this._items[i]);
|
||||
}
|
||||
list._size = this._size;
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>Copies the entire <see cref="T:System.Collections.Generic.List`1" /> to a compatible one-dimensional array, starting at the beginning 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.List`1" />. The <see cref="T:System.Array" /> must have zero-based indexing.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="array" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The number of elements in the source <see cref="T:System.Collections.Generic.List`1" /> is greater than the number of elements that the destination <paramref name="array" /> can contain.</exception>
|
||||
// Token: 0x06000D2A RID: 3370 RVA: 0x0003A5E0 File Offset: 0x000387E0
|
||||
public void CopyTo(T[] array)
|
||||
{
|
||||
Array.Copy(this._items, 0, array, 0, this._size);
|
||||
}
|
||||
|
||||
/// <summary>Copies the entire <see cref="T:System.Collections.Generic.List`1" /> to a compatible one-dimensional 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.List`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 0.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The number of elements in the source <see cref="T:System.Collections.Generic.List`1" /> is greater than the available space from <paramref name="arrayIndex" /> to the end of the destination <paramref name="array" />.</exception>
|
||||
// Token: 0x06000D2B RID: 3371 RVA: 0x0003A5F8 File Offset: 0x000387F8
|
||||
public void CopyTo(T[] array, int arrayIndex)
|
||||
{
|
||||
Array.Copy(this._items, 0, array, arrayIndex, this._size);
|
||||
}
|
||||
|
||||
/// <summary>Copies a range of elements from the <see cref="T:System.Collections.Generic.List`1" /> to a compatible one-dimensional array, starting at the specified index of the target array.</summary>
|
||||
/// <param name="index">The zero-based index in the source <see cref="T:System.Collections.Generic.List`1" /> at which copying begins.</param>
|
||||
/// <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.List`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>
|
||||
/// <param name="count">The number of elements to copy.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="array" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="index" /> is less than 0.-or-<paramref name="arrayIndex" /> is less than 0.-or-<paramref name="count" /> is less than 0. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="index" /> is equal to or greater than the <see cref="P:System.Collections.Generic.List`1.Count" /> of the source <see cref="T:System.Collections.Generic.List`1" />.-or-The number of elements from <paramref name="index" /> to the end of the source <see cref="T:System.Collections.Generic.List`1" /> is greater than the available space from <paramref name="arrayIndex" /> to the end of the destination <paramref name="array" />. </exception>
|
||||
// Token: 0x06000D2C RID: 3372 RVA: 0x0003A610 File Offset: 0x00038810
|
||||
public void CopyTo(int index, T[] array, int arrayIndex, int count)
|
||||
{
|
||||
this.CheckRange(index, count);
|
||||
Array.Copy(this._items, index, array, arrayIndex, count);
|
||||
}
|
||||
|
||||
/// <summary>Determines whether the <see cref="T:System.Collections.Generic.List`1" /> contains elements that match the conditions defined by the specified predicate.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Collections.Generic.List`1" /> contains one or more elements that match the conditions defined by the specified predicate; otherwise, false.</returns>
|
||||
/// <param name="match">The <see cref="T:System.Predicate`1" /> delegate that defines the conditions of the elements to search for.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="match" /> is null.</exception>
|
||||
// Token: 0x06000D2D RID: 3373 RVA: 0x0003A638 File Offset: 0x00038838
|
||||
public bool Exists(Predicate<T> match)
|
||||
{
|
||||
List<T>.CheckMatch(match);
|
||||
return this.GetIndex(0, this._size, match) != -1;
|
||||
}
|
||||
|
||||
/// <summary>Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
/// <returns>The first element that matches the conditions defined by the specified predicate, if found; otherwise, the default value for type <paramref name="T" />.</returns>
|
||||
/// <param name="match">The <see cref="T:System.Predicate`1" /> delegate that defines the conditions of the element to search for.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="match" /> is null.</exception>
|
||||
// Token: 0x06000D2E RID: 3374 RVA: 0x0003A654 File Offset: 0x00038854
|
||||
public T Find(Predicate<T> match)
|
||||
{
|
||||
List<T>.CheckMatch(match);
|
||||
int index = this.GetIndex(0, this._size, match);
|
||||
return (index == -1) ? default(T) : this._items[index];
|
||||
}
|
||||
|
||||
// Token: 0x06000D2F RID: 3375 RVA: 0x0003A698 File Offset: 0x00038898
|
||||
private static void CheckMatch(Predicate<T> match)
|
||||
{
|
||||
if (match == null)
|
||||
{
|
||||
throw new ArgumentNullException("match");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Retrieves all the elements that match the conditions defined by the specified predicate.</summary>
|
||||
/// <returns>A <see cref="T:System.Collections.Generic.List`1" /> containing all the elements that match the conditions defined by the specified predicate, if found; otherwise, an empty <see cref="T:System.Collections.Generic.List`1" />.</returns>
|
||||
/// <param name="match">The <see cref="T:System.Predicate`1" /> delegate that defines the conditions of the elements to search for.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="match" /> is null.</exception>
|
||||
// Token: 0x06000D30 RID: 3376 RVA: 0x0003A6AC File Offset: 0x000388AC
|
||||
public List<T> FindAll(Predicate<T> match)
|
||||
{
|
||||
List<T>.CheckMatch(match);
|
||||
if (this._size <= 65536)
|
||||
{
|
||||
return this.FindAllStackBits(match);
|
||||
}
|
||||
return this.FindAllList(match);
|
||||
}
|
||||
|
||||
// Token: 0x06000D31 RID: 3377 RVA: 0x0003A6D4 File Offset: 0x000388D4
|
||||
private unsafe List<T> FindAllStackBits(Predicate<T> match)
|
||||
{
|
||||
uint* ptr;
|
||||
uint* ptr2;
|
||||
int num;
|
||||
uint num2;
|
||||
checked
|
||||
{
|
||||
ptr = stackalloc uint[unchecked(this._size / 32 + 1) * 4];
|
||||
ptr2 = ptr;
|
||||
num = 0;
|
||||
num2 = 2147483648U;
|
||||
}
|
||||
for (int i = 0; i < this._size; i++)
|
||||
{
|
||||
if (match(this._items[i]))
|
||||
{
|
||||
*ptr2 |= num2;
|
||||
num++;
|
||||
}
|
||||
num2 >>= 1;
|
||||
if (num2 == 0U)
|
||||
{
|
||||
ptr2++;
|
||||
num2 = 2147483648U;
|
||||
}
|
||||
}
|
||||
T[] array = new T[num];
|
||||
num2 = 2147483648U;
|
||||
ptr2 = ptr;
|
||||
int num3 = 0;
|
||||
int num4 = 0;
|
||||
while (num4 < this._size && num3 < num)
|
||||
{
|
||||
if ((*ptr2 & num2) == num2)
|
||||
{
|
||||
array[num3++] = this._items[num4];
|
||||
}
|
||||
num2 >>= 1;
|
||||
if (num2 == 0U)
|
||||
{
|
||||
ptr2++;
|
||||
num2 = 2147483648U;
|
||||
}
|
||||
num4++;
|
||||
}
|
||||
return new List<T>(array, num);
|
||||
}
|
||||
|
||||
// Token: 0x06000D32 RID: 3378 RVA: 0x0003A7C8 File Offset: 0x000389C8
|
||||
private List<T> FindAllList(Predicate<T> match)
|
||||
{
|
||||
List<T> list = new List<T>();
|
||||
for (int i = 0; i < this._size; i++)
|
||||
{
|
||||
if (match(this._items[i]))
|
||||
{
|
||||
list.Add(this._items[i]);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the entire <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
/// <returns>The zero-based index of the first occurrence of an element that matches the conditions defined by <paramref name="match" />, if found; otherwise, –1.</returns>
|
||||
/// <param name="match">The <see cref="T:System.Predicate`1" /> delegate that defines the conditions of the element to search for.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="match" /> is null.</exception>
|
||||
// Token: 0x06000D33 RID: 3379 RVA: 0x0003A81C File Offset: 0x00038A1C
|
||||
public int FindIndex(Predicate<T> match)
|
||||
{
|
||||
List<T>.CheckMatch(match);
|
||||
return this.GetIndex(0, this._size, match);
|
||||
}
|
||||
|
||||
/// <summary>Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the <see cref="T:System.Collections.Generic.List`1" /> that extends from the specified index to the last element.</summary>
|
||||
/// <returns>The zero-based index of the first occurrence of an element that matches the conditions defined by <paramref name="match" />, if found; otherwise, –1.</returns>
|
||||
/// <param name="startIndex">The zero-based starting index of the search.</param>
|
||||
/// <param name="match">The <see cref="T:System.Predicate`1" /> delegate that defines the conditions of the element to search for.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="match" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="startIndex" /> is outside the range of valid indexes for the <see cref="T:System.Collections.Generic.List`1" />.</exception>
|
||||
// Token: 0x06000D34 RID: 3380 RVA: 0x0003A834 File Offset: 0x00038A34
|
||||
public int FindIndex(int startIndex, Predicate<T> match)
|
||||
{
|
||||
List<T>.CheckMatch(match);
|
||||
this.CheckIndex(startIndex);
|
||||
return this.GetIndex(startIndex, this._size - startIndex, match);
|
||||
}
|
||||
|
||||
/// <summary>Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the <see cref="T:System.Collections.Generic.List`1" /> that starts at the specified index and contains the specified number of elements.</summary>
|
||||
/// <returns>The zero-based index of the first occurrence of an element that matches the conditions defined by <paramref name="match" />, if found; otherwise, –1.</returns>
|
||||
/// <param name="startIndex">The zero-based starting index of the search.</param>
|
||||
/// <param name="count">The number of elements in the section to search.</param>
|
||||
/// <param name="match">The <see cref="T:System.Predicate`1" /> delegate that defines the conditions of the element to search for.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="match" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="startIndex" /> is outside the range of valid indexes for the <see cref="T:System.Collections.Generic.List`1" />.-or-<paramref name="count" /> is less than 0.-or-<paramref name="startIndex" /> and <paramref name="count" /> do not specify a valid section in the <see cref="T:System.Collections.Generic.List`1" />.</exception>
|
||||
// Token: 0x06000D35 RID: 3381 RVA: 0x0003A860 File Offset: 0x00038A60
|
||||
public int FindIndex(int startIndex, int count, Predicate<T> match)
|
||||
{
|
||||
List<T>.CheckMatch(match);
|
||||
this.CheckRange(startIndex, count);
|
||||
return this.GetIndex(startIndex, count, match);
|
||||
}
|
||||
|
||||
// Token: 0x06000D36 RID: 3382 RVA: 0x0003A884 File Offset: 0x00038A84
|
||||
private int GetIndex(int startIndex, int count, Predicate<T> match)
|
||||
{
|
||||
int num = startIndex + count;
|
||||
for (int i = startIndex; i < num; i++)
|
||||
{
|
||||
if (match(this._items[i]))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// <summary>Searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
/// <returns>The last element that matches the conditions defined by the specified predicate, if found; otherwise, the default value for type <paramref name="T" />.</returns>
|
||||
/// <param name="match">The <see cref="T:System.Predicate`1" /> delegate that defines the conditions of the element to search for.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="match" /> is null.</exception>
|
||||
// Token: 0x06000D37 RID: 3383 RVA: 0x0003A8C4 File Offset: 0x00038AC4
|
||||
public T FindLast(Predicate<T> match)
|
||||
{
|
||||
List<T>.CheckMatch(match);
|
||||
int lastIndex = this.GetLastIndex(0, this._size, match);
|
||||
return (lastIndex != -1) ? this[lastIndex] : default(T);
|
||||
}
|
||||
|
||||
/// <summary>Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the entire <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
/// <returns>The zero-based index of the last occurrence of an element that matches the conditions defined by <paramref name="match" />, if found; otherwise, –1.</returns>
|
||||
/// <param name="match">The <see cref="T:System.Predicate`1" /> delegate that defines the conditions of the element to search for.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="match" /> is null.</exception>
|
||||
// Token: 0x06000D38 RID: 3384 RVA: 0x0003A904 File Offset: 0x00038B04
|
||||
public int FindLastIndex(Predicate<T> match)
|
||||
{
|
||||
List<T>.CheckMatch(match);
|
||||
return this.GetLastIndex(0, this._size, match);
|
||||
}
|
||||
|
||||
/// <summary>Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the <see cref="T:System.Collections.Generic.List`1" /> that extends from the first element to the specified index.</summary>
|
||||
/// <returns>The zero-based index of the last occurrence of an element that matches the conditions defined by <paramref name="match" />, if found; otherwise, –1.</returns>
|
||||
/// <param name="startIndex">The zero-based starting index of the backward search.</param>
|
||||
/// <param name="match">The <see cref="T:System.Predicate`1" /> delegate that defines the conditions of the element to search for.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="match" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="startIndex" /> is outside the range of valid indexes for the <see cref="T:System.Collections.Generic.List`1" />.</exception>
|
||||
// Token: 0x06000D39 RID: 3385 RVA: 0x0003A91C File Offset: 0x00038B1C
|
||||
public int FindLastIndex(int startIndex, Predicate<T> match)
|
||||
{
|
||||
List<T>.CheckMatch(match);
|
||||
this.CheckIndex(startIndex);
|
||||
return this.GetLastIndex(0, startIndex + 1, match);
|
||||
}
|
||||
|
||||
/// <summary>Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the <see cref="T:System.Collections.Generic.List`1" /> that contains the specified number of elements and ends at the specified index.</summary>
|
||||
/// <returns>The zero-based index of the last occurrence of an element that matches the conditions defined by <paramref name="match" />, if found; otherwise, –1.</returns>
|
||||
/// <param name="startIndex">The zero-based starting index of the backward search.</param>
|
||||
/// <param name="count">The number of elements in the section to search.</param>
|
||||
/// <param name="match">The <see cref="T:System.Predicate`1" /> delegate that defines the conditions of the element to search for.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="match" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="startIndex" /> is outside the range of valid indexes for the <see cref="T:System.Collections.Generic.List`1" />.-or-<paramref name="count" /> is less than 0.-or-<paramref name="startIndex" /> and <paramref name="count" /> do not specify a valid section in the <see cref="T:System.Collections.Generic.List`1" />.</exception>
|
||||
// Token: 0x06000D3A RID: 3386 RVA: 0x0003A944 File Offset: 0x00038B44
|
||||
public int FindLastIndex(int startIndex, int count, Predicate<T> match)
|
||||
{
|
||||
List<T>.CheckMatch(match);
|
||||
int num = startIndex - count + 1;
|
||||
this.CheckRange(num, count);
|
||||
return this.GetLastIndex(num, count, match);
|
||||
}
|
||||
|
||||
// Token: 0x06000D3B RID: 3387 RVA: 0x0003A970 File Offset: 0x00038B70
|
||||
private int GetLastIndex(int startIndex, int count, Predicate<T> match)
|
||||
{
|
||||
int num = startIndex + count;
|
||||
while (num != startIndex)
|
||||
{
|
||||
if (match(this._items[--num]))
|
||||
{
|
||||
return num;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// <summary>Performs the specified action on each element of the <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
/// <param name="action">The <see cref="T:System.Action`1" /> delegate to perform on each element of the <see cref="T:System.Collections.Generic.List`1" />.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="action" /> is null.</exception>
|
||||
// Token: 0x06000D3C RID: 3388 RVA: 0x0003A9AC File Offset: 0x00038BAC
|
||||
public void ForEach(Action<T> action)
|
||||
{
|
||||
if (action == null)
|
||||
{
|
||||
throw new ArgumentNullException("action");
|
||||
}
|
||||
for (int i = 0; i < this._size; i++)
|
||||
{
|
||||
action(this._items[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Returns an enumerator that iterates through the <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
/// <returns>A <see cref="T:System.Collections.Generic.List`1.Enumerator" /> for the <see cref="T:System.Collections.Generic.List`1" />.</returns>
|
||||
// Token: 0x06000D3D RID: 3389 RVA: 0x0003A9F4 File Offset: 0x00038BF4
|
||||
public List<T>.Enumerator GetEnumerator()
|
||||
{
|
||||
return new List<T>.Enumerator(this);
|
||||
}
|
||||
|
||||
/// <summary>Creates a shallow copy of a range of elements in the source <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
/// <returns>A shallow copy of a range of elements in the source <see cref="T:System.Collections.Generic.List`1" />.</returns>
|
||||
/// <param name="index">The zero-based <see cref="T:System.Collections.Generic.List`1" /> index at which the range starts.</param>
|
||||
/// <param name="count">The number of elements in the range.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="index" /> is less than 0.-or-<paramref name="count" /> is less than 0.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="index" /> and <paramref name="count" /> do not denote a valid range of elements in the <see cref="T:System.Collections.Generic.List`1" />.</exception>
|
||||
// Token: 0x06000D3E RID: 3390 RVA: 0x0003A9FC File Offset: 0x00038BFC
|
||||
public List<T> GetRange(int index, int count)
|
||||
{
|
||||
this.CheckRange(index, count);
|
||||
T[] array = new T[count];
|
||||
Array.Copy(this._items, index, array, 0, count);
|
||||
return new List<T>(array, count);
|
||||
}
|
||||
|
||||
/// <summary>Searches for the specified object and returns the zero-based index of the first occurrence within the entire <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
/// <returns>The zero-based index of the first occurrence of <paramref name="item" /> within the entire <see cref="T:System.Collections.Generic.List`1" />, if found; otherwise, –1.</returns>
|
||||
/// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.List`1" />. The value can be null for reference types.</param>
|
||||
// Token: 0x06000D3F RID: 3391 RVA: 0x0003AA30 File Offset: 0x00038C30
|
||||
public int IndexOf(T item)
|
||||
{
|
||||
return Array.IndexOf<T>(this._items, item, 0, this._size);
|
||||
}
|
||||
|
||||
/// <summary>Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the <see cref="T:System.Collections.Generic.List`1" /> that extends from the specified index to the last element.</summary>
|
||||
/// <returns>The zero-based index of the first occurrence of <paramref name="item" /> within the range of elements in the <see cref="T:System.Collections.Generic.List`1" /> that extends from <paramref name="index" /> to the last element, if found; otherwise, –1.</returns>
|
||||
/// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.List`1" />. The value can be null for reference types.</param>
|
||||
/// <param name="index">The zero-based starting index of the search. 0 (zero) is valid in an empty list.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="index" /> is outside the range of valid indexes for the <see cref="T:System.Collections.Generic.List`1" />.</exception>
|
||||
// Token: 0x06000D40 RID: 3392 RVA: 0x0003AA48 File Offset: 0x00038C48
|
||||
public int IndexOf(T item, int index)
|
||||
{
|
||||
this.CheckIndex(index);
|
||||
return Array.IndexOf<T>(this._items, item, index, this._size - index);
|
||||
}
|
||||
|
||||
/// <summary>Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the <see cref="T:System.Collections.Generic.List`1" /> that starts at the specified index and contains the specified number of elements.</summary>
|
||||
/// <returns>The zero-based index of the first occurrence of <paramref name="item" /> within the range of elements in the <see cref="T:System.Collections.Generic.List`1" /> that starts at <paramref name="index" /> and contains <paramref name="count" /> number of elements, if found; otherwise, –1.</returns>
|
||||
/// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.List`1" />. The value can be null for reference types.</param>
|
||||
/// <param name="index">The zero-based starting index of the search. 0 (zero) is valid in an empty list.</param>
|
||||
/// <param name="count">The number of elements in the section to search.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="index" /> is outside the range of valid indexes for the <see cref="T:System.Collections.Generic.List`1" />.-or-<paramref name="count" /> is less than 0.-or-<paramref name="index" /> and <paramref name="count" /> do not specify a valid section in the <see cref="T:System.Collections.Generic.List`1" />.</exception>
|
||||
// Token: 0x06000D41 RID: 3393 RVA: 0x0003AA74 File Offset: 0x00038C74
|
||||
public int IndexOf(T item, int index, int count)
|
||||
{
|
||||
if (index < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("index");
|
||||
}
|
||||
if (count < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("count");
|
||||
}
|
||||
if (index + count > this._size)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("index and count exceed length of list");
|
||||
}
|
||||
return Array.IndexOf<T>(this._items, item, index, count);
|
||||
}
|
||||
|
||||
// Token: 0x06000D42 RID: 3394 RVA: 0x0003AACC File Offset: 0x00038CCC
|
||||
private void Shift(int start, int delta)
|
||||
{
|
||||
if (delta < 0)
|
||||
{
|
||||
start -= delta;
|
||||
}
|
||||
if (start < this._size)
|
||||
{
|
||||
Array.Copy(this._items, start, this._items, start + delta, this._size - start);
|
||||
}
|
||||
this._size += delta;
|
||||
if (delta < 0)
|
||||
{
|
||||
Array.Clear(this._items, this._size, -delta);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000D43 RID: 3395 RVA: 0x0003AB38 File Offset: 0x00038D38
|
||||
private void CheckIndex(int index)
|
||||
{
|
||||
if (index < 0 || index > this._size)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("index");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Inserts an element into the <see cref="T:System.Collections.Generic.List`1" /> at the specified index.</summary>
|
||||
/// <param name="index">The zero-based index at which <paramref name="item" /> should be inserted.</param>
|
||||
/// <param name="item">The object to insert. The value can be null for reference types.</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.Generic.List`1.Count" />.</exception>
|
||||
// Token: 0x06000D44 RID: 3396 RVA: 0x0003AB58 File Offset: 0x00038D58
|
||||
public void Insert(int index, T item)
|
||||
{
|
||||
this.CheckIndex(index);
|
||||
if (this._size == this._items.Length)
|
||||
{
|
||||
this.GrowIfNeeded(1);
|
||||
}
|
||||
this.Shift(index, 1);
|
||||
this._items[index] = item;
|
||||
this._version++;
|
||||
}
|
||||
|
||||
// Token: 0x06000D45 RID: 3397 RVA: 0x0003ABAC File Offset: 0x00038DAC
|
||||
private void CheckCollection(IEnumerable<T> collection)
|
||||
{
|
||||
if (collection == null)
|
||||
{
|
||||
throw new ArgumentNullException("collection");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Inserts the elements of a collection into the <see cref="T:System.Collections.Generic.List`1" /> at the specified index.</summary>
|
||||
/// <param name="index">The zero-based index at which the new elements should be inserted.</param>
|
||||
/// <param name="collection">The collection whose elements should be inserted into the <see cref="T:System.Collections.Generic.List`1" />. The collection itself cannot be null, but it can contain elements that are null, if type <paramref name="T" /> is a reference type.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="collection" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="index" /> is less than 0.-or-<paramref name="index" /> is greater than <see cref="P:System.Collections.Generic.List`1.Count" />.</exception>
|
||||
// Token: 0x06000D46 RID: 3398 RVA: 0x0003ABC0 File Offset: 0x00038DC0
|
||||
public void InsertRange(int index, IEnumerable<T> collection)
|
||||
{
|
||||
this.CheckCollection(collection);
|
||||
this.CheckIndex(index);
|
||||
if (collection == this)
|
||||
{
|
||||
T[] array = new T[this._size];
|
||||
this.CopyTo(array, 0);
|
||||
this.GrowIfNeeded(this._size);
|
||||
this.Shift(index, array.Length);
|
||||
Array.Copy(array, 0, this._items, index, array.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
ICollection<T> collection2 = collection as ICollection<T>;
|
||||
if (collection2 != null)
|
||||
{
|
||||
this.InsertCollection(index, collection2);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.InsertEnumeration(index, collection);
|
||||
}
|
||||
}
|
||||
this._version++;
|
||||
}
|
||||
|
||||
// Token: 0x06000D47 RID: 3399 RVA: 0x0003AC54 File Offset: 0x00038E54
|
||||
private void InsertCollection(int index, ICollection<T> collection)
|
||||
{
|
||||
int count = collection.Count;
|
||||
this.GrowIfNeeded(count);
|
||||
this.Shift(index, count);
|
||||
collection.CopyTo(this._items, index);
|
||||
}
|
||||
|
||||
// Token: 0x06000D48 RID: 3400 RVA: 0x0003AC84 File Offset: 0x00038E84
|
||||
private void InsertEnumeration(int index, IEnumerable<T> enumerable)
|
||||
{
|
||||
foreach (T t in enumerable)
|
||||
{
|
||||
this.Insert(index++, t);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Searches for the specified object and returns the zero-based index of the last occurrence within the entire <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
/// <returns>The zero-based index of the last occurrence of <paramref name="item" /> within the entire the <see cref="T:System.Collections.Generic.List`1" />, if found; otherwise, –1.</returns>
|
||||
/// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.List`1" />. The value can be null for reference types.</param>
|
||||
// Token: 0x06000D49 RID: 3401 RVA: 0x0003ACE8 File Offset: 0x00038EE8
|
||||
public int LastIndexOf(T item)
|
||||
{
|
||||
return Array.LastIndexOf<T>(this._items, item, this._size - 1, this._size);
|
||||
}
|
||||
|
||||
/// <summary>Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the <see cref="T:System.Collections.Generic.List`1" /> that extends from the first element to the specified index.</summary>
|
||||
/// <returns>The zero-based index of the last occurrence of <paramref name="item" /> within the range of elements in the <see cref="T:System.Collections.Generic.List`1" /> that extends from the first element to <paramref name="index" />, if found; otherwise, –1.</returns>
|
||||
/// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.List`1" />. The value can be null for reference types.</param>
|
||||
/// <param name="index">The zero-based starting index of the backward search.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="index" /> is outside the range of valid indexes for the <see cref="T:System.Collections.Generic.List`1" />. </exception>
|
||||
// Token: 0x06000D4A RID: 3402 RVA: 0x0003AD04 File Offset: 0x00038F04
|
||||
public int LastIndexOf(T item, int index)
|
||||
{
|
||||
this.CheckIndex(index);
|
||||
return Array.LastIndexOf<T>(this._items, item, index, index + 1);
|
||||
}
|
||||
|
||||
/// <summary>Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the <see cref="T:System.Collections.Generic.List`1" /> that contains the specified number of elements and ends at the specified index.</summary>
|
||||
/// <returns>The zero-based index of the last occurrence of <paramref name="item" /> within the range of elements in the <see cref="T:System.Collections.Generic.List`1" /> that contains <paramref name="count" /> number of elements and ends at <paramref name="index" />, if found; otherwise, –1.</returns>
|
||||
/// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.List`1" />. The value can be null for reference types.</param>
|
||||
/// <param name="index">The zero-based starting index of the backward search.</param>
|
||||
/// <param name="count">The number of elements in the section to search.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="index" /> is outside the range of valid indexes for the <see cref="T:System.Collections.Generic.List`1" />.-or-<paramref name="count" /> is less than 0.-or-<paramref name="index" /> and <paramref name="count" /> do not specify a valid section in the <see cref="T:System.Collections.Generic.List`1" />. </exception>
|
||||
// Token: 0x06000D4B RID: 3403 RVA: 0x0003AD28 File Offset: 0x00038F28
|
||||
public int LastIndexOf(T item, int index, int count)
|
||||
{
|
||||
if (index < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("index", index, "index is negative");
|
||||
}
|
||||
if (count < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("count", count, "count is negative");
|
||||
}
|
||||
if (index - count + 1 < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("cound", count, "count is too large");
|
||||
}
|
||||
return Array.LastIndexOf<T>(this._items, item, index, count);
|
||||
}
|
||||
|
||||
/// <summary>Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
/// <returns>true if <paramref name="item" /> is successfully removed; otherwise, false. This method also returns false if <paramref name="item" /> was not found in the <see cref="T:System.Collections.Generic.List`1" />.</returns>
|
||||
/// <param name="item">The object to remove from the <see cref="T:System.Collections.Generic.List`1" />. The value can be null for reference types.</param>
|
||||
// Token: 0x06000D4C RID: 3404 RVA: 0x0003ADA0 File Offset: 0x00038FA0
|
||||
public bool Remove(T item)
|
||||
{
|
||||
int num = this.IndexOf(item);
|
||||
if (num != -1)
|
||||
{
|
||||
this.RemoveAt(num);
|
||||
}
|
||||
return num != -1;
|
||||
}
|
||||
|
||||
/// <summary>Removes all the elements that match the conditions defined by the specified predicate.</summary>
|
||||
/// <returns>The number of elements removed from the <see cref="T:System.Collections.Generic.List`1" /> .</returns>
|
||||
/// <param name="match">The <see cref="T:System.Predicate`1" /> delegate that defines the conditions of the elements to remove.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="match" /> is null.</exception>
|
||||
// Token: 0x06000D4D RID: 3405 RVA: 0x0003ADCC File Offset: 0x00038FCC
|
||||
public int RemoveAll(Predicate<T> match)
|
||||
{
|
||||
List<T>.CheckMatch(match);
|
||||
int i;
|
||||
for (i = 0; i < this._size; i++)
|
||||
{
|
||||
if (match(this._items[i]))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == this._size)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
this._version++;
|
||||
int j;
|
||||
for (j = i + 1; j < this._size; j++)
|
||||
{
|
||||
if (!match(this._items[j]))
|
||||
{
|
||||
this._items[i++] = this._items[j];
|
||||
}
|
||||
}
|
||||
if (j - i > 0)
|
||||
{
|
||||
Array.Clear(this._items, i, j - i);
|
||||
}
|
||||
this._size = i;
|
||||
return j - i;
|
||||
}
|
||||
|
||||
/// <summary>Removes the element at the specified index of the <see cref="T:System.Collections.Generic.List`1" />.</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.Generic.List`1.Count" />.</exception>
|
||||
// Token: 0x06000D4E RID: 3406 RVA: 0x0003AEA0 File Offset: 0x000390A0
|
||||
public void RemoveAt(int index)
|
||||
{
|
||||
if (index < 0 || index >= this._size)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("index");
|
||||
}
|
||||
this.Shift(index, -1);
|
||||
Array.Clear(this._items, this._size, 1);
|
||||
this._version++;
|
||||
}
|
||||
|
||||
/// <summary>Removes a range of elements from the <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
/// <param name="index">The zero-based starting index of the range of elements to remove.</param>
|
||||
/// <param name="count">The number of elements to remove.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="index" /> is less than 0.-or-<paramref name="count" /> is less than 0.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="index" /> and <paramref name="count" /> do not denote a valid range of elements in the <see cref="T:System.Collections.Generic.List`1" />.</exception>
|
||||
// Token: 0x06000D4F RID: 3407 RVA: 0x0003AEF4 File Offset: 0x000390F4
|
||||
public void RemoveRange(int index, int count)
|
||||
{
|
||||
this.CheckRange(index, count);
|
||||
if (count > 0)
|
||||
{
|
||||
this.Shift(index, -count);
|
||||
Array.Clear(this._items, this._size, count);
|
||||
this._version++;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Reverses the order of the elements in the entire <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
// Token: 0x06000D50 RID: 3408 RVA: 0x0003AF3C File Offset: 0x0003913C
|
||||
public void Reverse()
|
||||
{
|
||||
Array.Reverse(this._items, 0, this._size);
|
||||
this._version++;
|
||||
}
|
||||
|
||||
/// <summary>Reverses the order of the elements in the specified range.</summary>
|
||||
/// <param name="index">The zero-based starting index of the range to reverse.</param>
|
||||
/// <param name="count">The number of elements in the range to reverse.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="index" /> is less than 0.-or-<paramref name="count" /> is less than 0. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="index" /> and <paramref name="count" /> do not denote a valid range of elements in the <see cref="T:System.Collections.Generic.List`1" />. </exception>
|
||||
// Token: 0x06000D51 RID: 3409 RVA: 0x0003AF6C File Offset: 0x0003916C
|
||||
public void Reverse(int index, int count)
|
||||
{
|
||||
this.CheckRange(index, count);
|
||||
Array.Reverse(this._items, index, count);
|
||||
this._version++;
|
||||
}
|
||||
|
||||
/// <summary>Sorts the elements in the entire <see cref="T:System.Collections.Generic.List`1" /> using the default comparer.</summary>
|
||||
/// <exception cref="T:System.InvalidOperationException">The default comparer <see cref="P:System.Collections.Generic.Comparer`1.Default" /> cannot find an implementation of the <see cref="T:System.IComparable`1" /> generic interface or the <see cref="T:System.IComparable" /> interface for type <paramref name="T" />.</exception>
|
||||
// Token: 0x06000D52 RID: 3410 RVA: 0x0003AF9C File Offset: 0x0003919C
|
||||
public void Sort()
|
||||
{
|
||||
Array.Sort<T>(this._items, 0, this._size, Comparer<T>.Default);
|
||||
this._version++;
|
||||
}
|
||||
|
||||
/// <summary>Sorts the elements in the entire <see cref="T:System.Collections.Generic.List`1" /> using the specified comparer.</summary>
|
||||
/// <param name="comparer">The <see cref="T:System.Collections.Generic.IComparer`1" /> implementation to use when comparing elements, or null to use the default comparer <see cref="P:System.Collections.Generic.Comparer`1.Default" />.</param>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <paramref name="comparer" /> is null, and the default comparer <see cref="P:System.Collections.Generic.Comparer`1.Default" /> cannot find implementation of the <see cref="T:System.IComparable`1" /> generic interface or the <see cref="T:System.IComparable" /> interface for type <paramref name="T" />.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The implementation of <paramref name="comparer" /> caused an error during the sort. For example, <paramref name="comparer" /> might not return 0 when comparing an item with itself.</exception>
|
||||
// Token: 0x06000D53 RID: 3411 RVA: 0x0003AFC4 File Offset: 0x000391C4
|
||||
public void Sort(IComparer<T> comparer)
|
||||
{
|
||||
Array.Sort<T>(this._items, 0, this._size, comparer);
|
||||
this._version++;
|
||||
}
|
||||
|
||||
/// <summary>Sorts the elements in the entire <see cref="T:System.Collections.Generic.List`1" /> using the specified <see cref="T:System.Comparison`1" />.</summary>
|
||||
/// <param name="comparison">The <see cref="T:System.Comparison`1" /> to use when comparing elements.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="comparison" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The implementation of <paramref name="comparison" /> caused an error during the sort. For example, <paramref name="comparison" /> might not return 0 when comparing an item with itself.</exception>
|
||||
// Token: 0x06000D54 RID: 3412 RVA: 0x0003AFE8 File Offset: 0x000391E8
|
||||
public void Sort(Comparison<T> comparison)
|
||||
{
|
||||
Array.Sort<T>(this._items, this._size, comparison);
|
||||
this._version++;
|
||||
}
|
||||
|
||||
/// <summary>Sorts the elements in a range of elements in <see cref="T:System.Collections.Generic.List`1" /> using the specified comparer.</summary>
|
||||
/// <param name="index">The zero-based starting index of the range to sort.</param>
|
||||
/// <param name="count">The length of the range to sort.</param>
|
||||
/// <param name="comparer">The <see cref="T:System.Collections.Generic.IComparer`1" /> implementation to use when comparing elements, or null to use the default comparer <see cref="P:System.Collections.Generic.Comparer`1.Default" />.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="index" /> is less than 0.-or-<paramref name="count" /> is less than 0.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="index" /> and <paramref name="count" /> do not specify a valid range in the <see cref="T:System.Collections.Generic.List`1" />.-or-The implementation of <paramref name="comparer" /> caused an error during the sort. For example, <paramref name="comparer" /> might not return 0 when comparing an item with itself.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <paramref name="comparer" /> is null, and the default comparer <see cref="P:System.Collections.Generic.Comparer`1.Default" /> cannot find implementation of the <see cref="T:System.IComparable`1" /> generic interface or the <see cref="T:System.IComparable" /> interface for type <paramref name="T" />.</exception>
|
||||
// Token: 0x06000D55 RID: 3413 RVA: 0x0003B018 File Offset: 0x00039218
|
||||
public void Sort(int index, int count, IComparer<T> comparer)
|
||||
{
|
||||
this.CheckRange(index, count);
|
||||
Array.Sort<T>(this._items, index, count, comparer);
|
||||
this._version++;
|
||||
}
|
||||
|
||||
/// <summary>Copies the elements of the <see cref="T:System.Collections.Generic.List`1" /> to a new array.</summary>
|
||||
/// <returns>An array containing copies of the elements of the <see cref="T:System.Collections.Generic.List`1" />.</returns>
|
||||
// Token: 0x06000D56 RID: 3414 RVA: 0x0003B04C File Offset: 0x0003924C
|
||||
public T[] ToArray()
|
||||
{
|
||||
T[] array = new T[this._size];
|
||||
Array.Copy(this._items, array, this._size);
|
||||
return array;
|
||||
}
|
||||
|
||||
/// <summary>Sets the capacity to the actual number of elements in the <see cref="T:System.Collections.Generic.List`1" />, if that number is less than a threshold value.</summary>
|
||||
// Token: 0x06000D57 RID: 3415 RVA: 0x0003B078 File Offset: 0x00039278
|
||||
public void TrimExcess()
|
||||
{
|
||||
this.Capacity = this._size;
|
||||
}
|
||||
|
||||
/// <summary>Determines whether every element in the <see cref="T:System.Collections.Generic.List`1" /> matches the conditions defined by the specified predicate.</summary>
|
||||
/// <returns>true if every element in the <see cref="T:System.Collections.Generic.List`1" /> matches the conditions defined by the specified predicate; otherwise, false. If the list has no elements, the return value is true.</returns>
|
||||
/// <param name="match">The <see cref="T:System.Predicate`1" /> delegate that defines the conditions to check against the elements.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="match" /> is null.</exception>
|
||||
// Token: 0x06000D58 RID: 3416 RVA: 0x0003B088 File Offset: 0x00039288
|
||||
public bool TrueForAll(Predicate<T> match)
|
||||
{
|
||||
List<T>.CheckMatch(match);
|
||||
for (int i = 0; i < this._size; i++)
|
||||
{
|
||||
if (!match(this._items[i]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the total number of elements the internal data structure can hold without resizing.</summary>
|
||||
/// <returns>The number of elements that the <see cref="T:System.Collections.Generic.List`1" /> can contain before resizing is required.</returns>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <see cref="P:System.Collections.Generic.List`1.Capacity" /> is set to a value that is less than <see cref="P:System.Collections.Generic.List`1.Count" />. </exception>
|
||||
/// <exception cref="T:System.OutOfMemoryException">There is not enough memory available on the system.</exception>
|
||||
// Token: 0x170001FA RID: 506
|
||||
// (get) Token: 0x06000D59 RID: 3417 RVA: 0x0003B0CC File Offset: 0x000392CC
|
||||
// (set) Token: 0x06000D5A RID: 3418 RVA: 0x0003B0D8 File Offset: 0x000392D8
|
||||
public int Capacity
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._items.Length;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value < this._size)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
Array.Resize<T>(ref this._items, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the number of elements actually contained in the <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
/// <returns>The number of elements actually contained in the <see cref="T:System.Collections.Generic.List`1" />.</returns>
|
||||
// Token: 0x170001FB RID: 507
|
||||
// (get) Token: 0x06000D5B RID: 3419 RVA: 0x0003B0F8 File Offset: 0x000392F8
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._size;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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.Generic.List`1.Count" />. </exception>
|
||||
// Token: 0x170001FC RID: 508
|
||||
public T this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
if (index >= this._size)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("index");
|
||||
}
|
||||
return this._items[index];
|
||||
}
|
||||
set
|
||||
{
|
||||
this.CheckIndex(index);
|
||||
if (index == this._size)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("index");
|
||||
}
|
||||
this._items[index] = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400037E RID: 894
|
||||
private const int DefaultCapacity = 4;
|
||||
|
||||
// Token: 0x0400037F RID: 895
|
||||
private T[] _items;
|
||||
|
||||
// Token: 0x04000380 RID: 896
|
||||
private int _size;
|
||||
|
||||
// Token: 0x04000381 RID: 897
|
||||
private int _version;
|
||||
|
||||
// Token: 0x04000382 RID: 898
|
||||
private static readonly T[] EmptyArray = new T[0];
|
||||
|
||||
/// <summary>Enumerates the elements of a <see cref="T:System.Collections.Generic.List`1" />.</summary>
|
||||
// Token: 0x0200010F RID: 271
|
||||
[Serializable]
|
||||
public struct Enumerator : IEnumerator, IDisposable, IEnumerator<T>
|
||||
{
|
||||
// Token: 0x06000D5E RID: 3422 RVA: 0x0003B158 File Offset: 0x00039358
|
||||
internal Enumerator(List<T> l)
|
||||
{
|
||||
this.l = l;
|
||||
this.ver = l._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: 0x06000D5F RID: 3423 RVA: 0x0003B170 File Offset: 0x00039370
|
||||
void IEnumerator.Reset()
|
||||
{
|
||||
this.VerifyState();
|
||||
this.next = 0;
|
||||
}
|
||||
|
||||
/// <summary>Gets the element at the current position of the enumerator.</summary>
|
||||
/// <returns>The element in the <see cref="T:System.Collections.Generic.List`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: 0x170001FD RID: 509
|
||||
// (get) Token: 0x06000D60 RID: 3424 RVA: 0x0003B180 File Offset: 0x00039380
|
||||
object IEnumerator.Current
|
||||
{
|
||||
get
|
||||
{
|
||||
this.VerifyState();
|
||||
if (this.next <= 0)
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
return this.current;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Releases all resources used by the <see cref="T:System.Collections.Generic.List`1.Enumerator" />.</summary>
|
||||
// Token: 0x06000D61 RID: 3425 RVA: 0x0003B1A8 File Offset: 0x000393A8
|
||||
public void Dispose()
|
||||
{
|
||||
this.l = null;
|
||||
}
|
||||
|
||||
// Token: 0x06000D62 RID: 3426 RVA: 0x0003B1B4 File Offset: 0x000393B4
|
||||
private void VerifyState()
|
||||
{
|
||||
if (this.l == null)
|
||||
{
|
||||
throw new ObjectDisposedException(base.GetType().FullName);
|
||||
}
|
||||
if (this.ver != this.l._version)
|
||||
{
|
||||
throw new InvalidOperationException("Collection was modified; enumeration operation may not execute.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Advances the enumerator to the next element of the <see cref="T:System.Collections.Generic.List`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: 0x06000D63 RID: 3427 RVA: 0x0003B208 File Offset: 0x00039408
|
||||
public bool MoveNext()
|
||||
{
|
||||
this.VerifyState();
|
||||
if (this.next < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (this.next < this.l._size)
|
||||
{
|
||||
this.current = this.l._items[this.next++];
|
||||
return true;
|
||||
}
|
||||
this.next = -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>Gets the element at the current position of the enumerator.</summary>
|
||||
/// <returns>The element in the <see cref="T:System.Collections.Generic.List`1" /> at the current position of the enumerator.</returns>
|
||||
// Token: 0x170001FE RID: 510
|
||||
// (get) Token: 0x06000D64 RID: 3428 RVA: 0x0003B270 File Offset: 0x00039470
|
||||
public T Current
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.current;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000383 RID: 899
|
||||
private List<T> l;
|
||||
|
||||
// Token: 0x04000384 RID: 900
|
||||
private int next;
|
||||
|
||||
// Token: 0x04000385 RID: 901
|
||||
private int ver;
|
||||
|
||||
// Token: 0x04000386 RID: 902
|
||||
private T current;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user