using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
namespace System
{
/// Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the base class for all arrays in the common language runtime.
/// 1
// Token: 0x02000029 RID: 41
[ComVisible(true)]
[Serializable]
public abstract class Array : IEnumerable, ICloneable, ICollection, IList
{
// Token: 0x060003EB RID: 1003 RVA: 0x0000FB3C File Offset: 0x0000DD3C
private Array()
{
}
/// Gets or sets the element at the specified index.
/// The element at the specified index.
/// The index of the element to get or set.
///
/// is less than zero.-or- is equal to or greater than .
/// The current does not have exactly one dimension.
// Token: 0x17000010 RID: 16
object IList.this[int index]
{
get
{
if (index >= this.Length)
{
throw new IndexOutOfRangeException("index");
}
if (this.Rank > 1)
{
throw new ArgumentException(Locale.GetText("Only single dimension arrays are supported."));
}
return this.GetValueImpl(index);
}
set
{
if (index >= this.Length)
{
throw new IndexOutOfRangeException("index");
}
if (this.Rank > 1)
{
throw new ArgumentException(Locale.GetText("Only single dimension arrays are supported."));
}
this.SetValueImpl(value, index);
}
}
/// Implements . Throws a in all cases.
/// An exception is always thrown.
/// The object to be added to the .
/// In all cases.
// Token: 0x060003EE RID: 1006 RVA: 0x0000FBD4 File Offset: 0x0000DDD4
int IList.Add(object value)
{
throw new NotSupportedException();
}
/// Sets all elements in the to zero, to false, or to null, depending on the element type.
/// The is read-only.
// Token: 0x060003EF RID: 1007 RVA: 0x0000FBDC File Offset: 0x0000DDDC
void IList.Clear()
{
Array.Clear(this, this.GetLowerBound(0), this.Length);
}
/// Determines whether an element is in the .
/// true if is found in the ; otherwise, false.
/// The object to locate in the . The element to locate can be null for reference types.
/// The current is multidimensional.
// Token: 0x060003F0 RID: 1008 RVA: 0x0000FBF4 File Offset: 0x0000DDF4
bool IList.Contains(object value)
{
if (this.Rank > 1)
{
throw new RankException(Locale.GetText("Only single dimension arrays are supported."));
}
int length = this.Length;
for (int i = 0; i < length; i++)
{
if (object.Equals(this.GetValueImpl(i), value))
{
return true;
}
}
return false;
}
/// Searches for the specified object and returns the index of the first occurrence within the current one-dimensional instance.
/// The index of the first occurrence of within the entire , if found; otherwise, the lower bound of the minus 1.
/// The object to locate in the current .
/// The current is multidimensional.
// Token: 0x060003F1 RID: 1009 RVA: 0x0000FC4C File Offset: 0x0000DE4C
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
int IList.IndexOf(object value)
{
if (this.Rank > 1)
{
throw new RankException(Locale.GetText("Only single dimension arrays are supported."));
}
int length = this.Length;
for (int i = 0; i < length; i++)
{
if (object.Equals(this.GetValueImpl(i), value))
{
return i + this.GetLowerBound(0);
}
}
return this.GetLowerBound(0) - 1;
}
/// Implements . Throws a in all cases.
/// The index at which should be inserted.
/// The object to insert.
/// In all cases.
// Token: 0x060003F2 RID: 1010 RVA: 0x0000FCB4 File Offset: 0x0000DEB4
void IList.Insert(int index, object value)
{
throw new NotSupportedException();
}
/// Implements . Throws a in all cases.
/// The object to remove from the .
/// In all cases.
// Token: 0x060003F3 RID: 1011 RVA: 0x0000FCBC File Offset: 0x0000DEBC
void IList.Remove(object value)
{
throw new NotSupportedException();
}
/// Implements . Throws a in all cases.
/// The index of the element to remove.
/// In all cases.
// Token: 0x060003F4 RID: 1012 RVA: 0x0000FCC4 File Offset: 0x0000DEC4
void IList.RemoveAt(int index)
{
throw new NotSupportedException();
}
/// Gets the number of elements contained in the .
/// The number of elements contained in the .
// Token: 0x17000011 RID: 17
// (get) Token: 0x060003F5 RID: 1013 RVA: 0x0000FCCC File Offset: 0x0000DECC
int ICollection.Count
{
get
{
return this.Length;
}
}
// Token: 0x060003F6 RID: 1014 RVA: 0x0000FCD4 File Offset: 0x0000DED4
internal int InternalArray__ICollection_get_Count()
{
return this.Length;
}
// Token: 0x060003F7 RID: 1015 RVA: 0x0000FCDC File Offset: 0x0000DEDC
internal bool InternalArray__ICollection_get_IsReadOnly()
{
return true;
}
// Token: 0x060003F8 RID: 1016 RVA: 0x0000FCE0 File Offset: 0x0000DEE0
internal IEnumerator InternalArray__IEnumerable_GetEnumerator()
{
return new Array.InternalEnumerator(this);
}
// Token: 0x060003F9 RID: 1017 RVA: 0x0000FCF0 File Offset: 0x0000DEF0
internal void InternalArray__ICollection_Clear()
{
throw new NotSupportedException("Collection is read-only");
}
// Token: 0x060003FA RID: 1018 RVA: 0x0000FCFC File Offset: 0x0000DEFC
internal void InternalArray__ICollection_Add(T item)
{
throw new NotSupportedException("Collection is read-only");
}
// Token: 0x060003FB RID: 1019 RVA: 0x0000FD08 File Offset: 0x0000DF08
internal bool InternalArray__ICollection_Remove(T item)
{
throw new NotSupportedException("Collection is read-only");
}
// Token: 0x060003FC RID: 1020 RVA: 0x0000FD14 File Offset: 0x0000DF14
internal bool InternalArray__ICollection_Contains(T item)
{
if (this.Rank > 1)
{
throw new RankException(Locale.GetText("Only single dimension arrays are supported."));
}
int length = this.Length;
for (int i = 0; i < length; i++)
{
T t;
this.GetGenericValueImpl(i, out t);
if (item == null)
{
return t == null;
}
if (item.Equals(t))
{
return true;
}
}
return false;
}
// Token: 0x060003FD RID: 1021 RVA: 0x0000FD94 File Offset: 0x0000DF94
internal void InternalArray__ICollection_CopyTo(T[] array, int index)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (this.Rank > 1)
{
throw new RankException(Locale.GetText("Only single dimension arrays are supported."));
}
if (index + this.GetLength(0) > array.GetLowerBound(0) + array.GetLength(0))
{
throw new ArgumentException("Destination array was not long enough. Check destIndex and length, and the array's lower bounds.");
}
if (array.Rank > 1)
{
throw new RankException(Locale.GetText("Only single dimension arrays are supported."));
}
if (index < 0)
{
throw new ArgumentOutOfRangeException("index", Locale.GetText("Value has to be >= 0."));
}
Array.Copy(this, this.GetLowerBound(0), array, index, this.GetLength(0));
}
// Token: 0x060003FE RID: 1022 RVA: 0x0000FE44 File Offset: 0x0000E044
internal void InternalArray__Insert(int index, T item)
{
throw new NotSupportedException("Collection is read-only");
}
// Token: 0x060003FF RID: 1023 RVA: 0x0000FE50 File Offset: 0x0000E050
internal void InternalArray__RemoveAt(int index)
{
throw new NotSupportedException("Collection is read-only");
}
// Token: 0x06000400 RID: 1024 RVA: 0x0000FE5C File Offset: 0x0000E05C
internal int InternalArray__IndexOf(T item)
{
if (this.Rank > 1)
{
throw new RankException(Locale.GetText("Only single dimension arrays are supported."));
}
int length = this.Length;
int i = 0;
while (i < length)
{
T t;
this.GetGenericValueImpl(i, out t);
if (item == null)
{
if (t == null)
{
return i + this.GetLowerBound(0);
}
return this.GetLowerBound(0) - 1;
}
else
{
if (t.Equals(item))
{
return i + this.GetLowerBound(0);
}
i++;
}
}
return this.GetLowerBound(0) - 1;
}
// Token: 0x06000401 RID: 1025 RVA: 0x0000FEFC File Offset: 0x0000E0FC
internal T InternalArray__get_Item(int index)
{
if (index >= this.Length)
{
throw new ArgumentOutOfRangeException("index");
}
T t;
this.GetGenericValueImpl(index, out t);
return t;
}
// Token: 0x06000402 RID: 1026 RVA: 0x0000FF2C File Offset: 0x0000E12C
internal void InternalArray__set_Item(int index, T item)
{
if (index >= this.Length)
{
throw new ArgumentOutOfRangeException("index");
}
object[] array = this as object[];
if (array != null)
{
array[index] = item;
return;
}
this.SetGenericValueImpl(index, ref item);
}
// Token: 0x06000403 RID: 1027
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern void GetGenericValueImpl(int pos, out T value);
// Token: 0x06000404 RID: 1028
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern void SetGenericValueImpl(int pos, ref T value);
/// Gets a 32-bit integer that represents the total number of elements in all the dimensions of the .
/// A 32-bit integer that represents the total number of elements in all the dimensions of the ; zero if there are no elements in the array.
/// 1
// Token: 0x17000012 RID: 18
// (get) Token: 0x06000405 RID: 1029 RVA: 0x0000FF70 File Offset: 0x0000E170
public int Length
{
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
get
{
int num = this.GetLength(0);
for (int i = 1; i < this.Rank; i++)
{
num *= this.GetLength(i);
}
return num;
}
}
/// Gets a 64-bit integer that represents the total number of elements in all the dimensions of the .
/// A 64-bit integer that represents the total number of elements in all the dimensions of the .
/// 2
// Token: 0x17000013 RID: 19
// (get) Token: 0x06000406 RID: 1030 RVA: 0x0000FFA8 File Offset: 0x0000E1A8
[ComVisible(false)]
public long LongLength
{
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
get
{
return (long)this.Length;
}
}
/// Gets the zero-based rank (number of dimensions) of the .
/// The zero-based rank (number of dimensions) of the .
/// 1
// Token: 0x17000014 RID: 20
// (get) Token: 0x06000407 RID: 1031 RVA: 0x0000FFB4 File Offset: 0x0000E1B4
public int Rank
{
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
get
{
return this.GetRank();
}
}
// Token: 0x06000408 RID: 1032
[MethodImpl(MethodImplOptions.InternalCall)]
private extern int GetRank();
/// Gets a 32-bit integer that represents the number of elements in the specified dimension of the .
/// A 32-bit integer that represents the number of elements in the specified dimension.
/// A zero-based dimension of the whose length needs to be determined.
///
/// is less than zero.-or- is equal to or greater than .
/// 1
// Token: 0x06000409 RID: 1033
[MethodImpl(MethodImplOptions.InternalCall)]
public extern int GetLength(int dimension);
/// Gets a 64-bit integer that represents the number of elements in the specified dimension of the .
/// A 64-bit integer that represents the number of elements in the specified dimension.
/// A zero-based dimension of the whose length needs to be determined.
///
/// is less than zero.-or- is equal to or greater than .
/// 2
// Token: 0x0600040A RID: 1034 RVA: 0x0000FFBC File Offset: 0x0000E1BC
[ComVisible(false)]
public long GetLongLength(int dimension)
{
return (long)this.GetLength(dimension);
}
/// Gets the lower bound of the specified dimension in the .
/// The lower bound of the specified dimension in the .
/// A zero-based dimension of the whose lower bound needs to be determined.
///
/// is less than zero.-or- is equal to or greater than .
/// 1
// Token: 0x0600040B RID: 1035
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern int GetLowerBound(int dimension);
/// Gets the value at the specified position in the multidimensional . The indexes are specified as an array of 32-bit integers.
/// The value at the specified position in the multidimensional .
/// A one-dimensional array of 32-bit integers that represent the indexes specifying the position of the element to get.
///
/// is null.
/// The number of dimensions in the current is not equal to the number of elements in .
/// Any element in is outside the range of valid indexes for the corresponding dimension of the current .
/// 2
// Token: 0x0600040C RID: 1036
[MethodImpl(MethodImplOptions.InternalCall)]
public extern object GetValue(params int[] indices);
/// Sets a value to the element at the specified position in the multidimensional . The indexes are specified as an array of 32-bit integers.
/// The new value for the specified element.
/// A one-dimensional array of 32-bit integers that represent the indexes specifying the position of the element to set.
///
/// is null.
/// The number of dimensions in the current is not equal to the number of elements in .
///
/// cannot be cast to the element type of the current .
/// Any element in is outside the range of valid indexes for the corresponding dimension of the current .
/// 1
// Token: 0x0600040D RID: 1037
[MethodImpl(MethodImplOptions.InternalCall)]
public extern void SetValue(object value, params int[] indices);
// Token: 0x0600040E RID: 1038
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern object GetValueImpl(int pos);
// Token: 0x0600040F RID: 1039
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern void SetValueImpl(object value, int pos);
// Token: 0x06000410 RID: 1040
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern bool FastCopy(Array source, int source_idx, Array dest, int dest_idx, int length);
// Token: 0x06000411 RID: 1041
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern Array CreateInstanceImpl(Type elementType, int[] lengths, int[] bounds);
/// Gets a value indicating whether access to the is synchronized (thread safe).
/// This property is always false for all arrays.
/// 2
// Token: 0x17000015 RID: 21
// (get) Token: 0x06000412 RID: 1042 RVA: 0x0000FFC8 File Offset: 0x0000E1C8
public bool IsSynchronized
{
get
{
return false;
}
}
/// Gets an object that can be used to synchronize access to the .
/// An object that can be used to synchronize access to the .
/// 2
// Token: 0x17000016 RID: 22
// (get) Token: 0x06000413 RID: 1043 RVA: 0x0000FFCC File Offset: 0x0000E1CC
public object SyncRoot
{
get
{
return this;
}
}
/// Gets a value indicating whether the has a fixed size.
/// This property is always true for all arrays.
/// 2
// Token: 0x17000017 RID: 23
// (get) Token: 0x06000414 RID: 1044 RVA: 0x0000FFD0 File Offset: 0x0000E1D0
public bool IsFixedSize
{
get
{
return true;
}
}
/// Gets a value indicating whether the is read-only.
/// This property is always false for all arrays.
/// 2
// Token: 0x17000018 RID: 24
// (get) Token: 0x06000415 RID: 1045 RVA: 0x0000FFD4 File Offset: 0x0000E1D4
public bool IsReadOnly
{
get
{
return false;
}
}
/// Returns an for the .
/// An for the .
/// 2
// Token: 0x06000416 RID: 1046 RVA: 0x0000FFD8 File Offset: 0x0000E1D8
public IEnumerator GetEnumerator()
{
return new Array.SimpleEnumerator(this);
}
/// Gets the upper bound of the specified dimension in the .
/// The upper bound of the specified dimension in the .
/// A zero-based dimension of the whose upper bound needs to be determined.
///
/// is less than zero.-or- is equal to or greater than .
/// 1
// Token: 0x06000417 RID: 1047 RVA: 0x0000FFE0 File Offset: 0x0000E1E0
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public int GetUpperBound(int dimension)
{
return this.GetLowerBound(dimension) + this.GetLength(dimension) - 1;
}
/// Gets the value at the specified position in the one-dimensional . The index is specified as a 32-bit integer.
/// The value at the specified position in the one-dimensional .
/// A 32-bit integer that represents the position of the element to get.
/// The current does not have exactly one dimension.
///
/// is outside the range of valid indexes for the current .
/// 2
// Token: 0x06000418 RID: 1048 RVA: 0x0000FFF4 File Offset: 0x0000E1F4
public object GetValue(int index)
{
if (this.Rank != 1)
{
throw new ArgumentException(Locale.GetText("Array was not a one-dimensional array."));
}
if (index < this.GetLowerBound(0) || index > this.GetUpperBound(0))
{
throw new IndexOutOfRangeException(Locale.GetText("Index has to be between upper and lower bound of the array."));
}
return this.GetValueImpl(index - this.GetLowerBound(0));
}
/// Gets the value at the specified position in the two-dimensional . The indexes are specified as 32-bit integers.
/// The value at the specified position in the two-dimensional .
/// A 32-bit integer that represents the first-dimension index of the element to get.
/// A 32-bit integer that represents the second-dimension index of the element to get.
/// The current does not have exactly two dimensions.
/// Either or is outside the range of valid indexes for the corresponding dimension of the current .
/// 2
// Token: 0x06000419 RID: 1049 RVA: 0x00010058 File Offset: 0x0000E258
public object GetValue(int index1, int index2)
{
int[] array = new int[] { index1, index2 };
return this.GetValue(array);
}
/// Gets the value at the specified position in the three-dimensional . The indexes are specified as 32-bit integers.
/// The value at the specified position in the three-dimensional .
/// A 32-bit integer that represents the first-dimension index of the element to get.
/// A 32-bit integer that represents the second-dimension index of the element to get.
/// A 32-bit integer that represents the third-dimension index of the element to get.
/// The current does not have exactly three dimensions.
///
/// or or is outside the range of valid indexes for the corresponding dimension of the current .
/// 2
// Token: 0x0600041A RID: 1050 RVA: 0x0001007C File Offset: 0x0000E27C
public object GetValue(int index1, int index2, int index3)
{
int[] array = new int[] { index1, index2, index3 };
return this.GetValue(array);
}
/// Gets the value at the specified position in the one-dimensional . The index is specified as a 64-bit integer.
/// The value at the specified position in the one-dimensional .
/// A 64-bit integer that represents the position of the element to get.
/// The current does not have exactly one dimension.
///
/// is outside the range of valid indexes for the current .
/// 2
// Token: 0x0600041B RID: 1051 RVA: 0x000100A4 File Offset: 0x0000E2A4
[ComVisible(false)]
public object GetValue(long index)
{
if (index < 0L || index > 2147483647L)
{
throw new ArgumentOutOfRangeException("index", Locale.GetText("Value must be >= 0 and <= Int32.MaxValue."));
}
return this.GetValue((int)index);
}
/// Gets the value at the specified position in the two-dimensional . The indexes are specified as 64-bit integers.
/// The value at the specified position in the two-dimensional .
/// A 64-bit integer that represents the first-dimension index of the element to get.
/// A 64-bit integer that represents the second-dimension index of the element to get.
/// The current does not have exactly two dimensions.
/// Either or is outside the range of valid indexes for the corresponding dimension of the current .
/// 2
// Token: 0x0600041C RID: 1052 RVA: 0x000100D8 File Offset: 0x0000E2D8
[ComVisible(false)]
public object GetValue(long index1, long index2)
{
if (index1 < 0L || index1 > 2147483647L)
{
throw new ArgumentOutOfRangeException("index1", Locale.GetText("Value must be >= 0 and <= Int32.MaxValue."));
}
if (index2 < 0L || index2 > 2147483647L)
{
throw new ArgumentOutOfRangeException("index2", Locale.GetText("Value must be >= 0 and <= Int32.MaxValue."));
}
return this.GetValue((int)index1, (int)index2);
}
/// Gets the value at the specified position in the three-dimensional . The indexes are specified as 64-bit integers.
/// The value at the specified position in the three-dimensional .
/// A 64-bit integer that represents the first-dimension index of the element to get.
/// A 64-bit integer that represents the second-dimension index of the element to get.
/// A 64-bit integer that represents the third-dimension index of the element to get.
/// The current does not have exactly three dimensions.
///
/// or or is outside the range of valid indexes for the corresponding dimension of the current .
/// 2
// Token: 0x0600041D RID: 1053 RVA: 0x00010144 File Offset: 0x0000E344
[ComVisible(false)]
public object GetValue(long index1, long index2, long index3)
{
if (index1 < 0L || index1 > 2147483647L)
{
throw new ArgumentOutOfRangeException("index1", Locale.GetText("Value must be >= 0 and <= Int32.MaxValue."));
}
if (index2 < 0L || index2 > 2147483647L)
{
throw new ArgumentOutOfRangeException("index2", Locale.GetText("Value must be >= 0 and <= Int32.MaxValue."));
}
if (index3 < 0L || index3 > 2147483647L)
{
throw new ArgumentOutOfRangeException("index3", Locale.GetText("Value must be >= 0 and <= Int32.MaxValue."));
}
return this.GetValue((int)index1, (int)index2, (int)index3);
}
/// Sets a value to the element at the specified position in the one-dimensional . The index is specified as a 64-bit integer.
/// The new value for the specified element.
/// A 64-bit integer that represents the position of the element to set.
/// The current does not have exactly one dimension.
///
/// cannot be cast to the element type of the current .
///
/// is outside the range of valid indexes for the current .
/// 1
// Token: 0x0600041E RID: 1054 RVA: 0x000101D8 File Offset: 0x0000E3D8
[ComVisible(false)]
public void SetValue(object value, long index)
{
if (index < 0L || index > 2147483647L)
{
throw new ArgumentOutOfRangeException("index", Locale.GetText("Value must be >= 0 and <= Int32.MaxValue."));
}
this.SetValue(value, (int)index);
}
/// Sets a value to the element at the specified position in the two-dimensional . The indexes are specified as 64-bit integers.
/// The new value for the specified element.
/// A 64-bit integer that represents the first-dimension index of the element to set.
/// A 64-bit integer that represents the second-dimension index of the element to set.
/// The current does not have exactly two dimensions.
///
/// cannot be cast to the element type of the current .
/// Either or is outside the range of valid indexes for the corresponding dimension of the current .
/// 1
// Token: 0x0600041F RID: 1055 RVA: 0x00010218 File Offset: 0x0000E418
[ComVisible(false)]
public void SetValue(object value, long index1, long index2)
{
if (index1 < 0L || index1 > 2147483647L)
{
throw new ArgumentOutOfRangeException("index1", Locale.GetText("Value must be >= 0 and <= Int32.MaxValue."));
}
if (index2 < 0L || index2 > 2147483647L)
{
throw new ArgumentOutOfRangeException("index2", Locale.GetText("Value must be >= 0 and <= Int32.MaxValue."));
}
int[] array = new int[]
{
(int)index1,
(int)index2
};
this.SetValue(value, array);
}
/// Sets a value to the element at the specified position in the three-dimensional . The indexes are specified as 64-bit integers.
/// The new value for the specified element.
/// A 64-bit integer that represents the first-dimension index of the element to set.
/// A 64-bit integer that represents the second-dimension index of the element to set.
/// A 64-bit integer that represents the third-dimension index of the element to set.
/// The current does not have exactly three dimensions.
///
/// cannot be cast to the element type of the current .
///
/// or or is outside the range of valid indexes for the corresponding dimension of the current .
/// 1
// Token: 0x06000420 RID: 1056 RVA: 0x00010290 File Offset: 0x0000E490
[ComVisible(false)]
public void SetValue(object value, long index1, long index2, long index3)
{
if (index1 < 0L || index1 > 2147483647L)
{
throw new ArgumentOutOfRangeException("index1", Locale.GetText("Value must be >= 0 and <= Int32.MaxValue."));
}
if (index2 < 0L || index2 > 2147483647L)
{
throw new ArgumentOutOfRangeException("index2", Locale.GetText("Value must be >= 0 and <= Int32.MaxValue."));
}
if (index3 < 0L || index3 > 2147483647L)
{
throw new ArgumentOutOfRangeException("index3", Locale.GetText("Value must be >= 0 and <= Int32.MaxValue."));
}
int[] array = new int[]
{
(int)index1,
(int)index2,
(int)index3
};
this.SetValue(value, array);
}
/// Sets a value to the element at the specified position in the one-dimensional . The index is specified as a 32-bit integer.
/// The new value for the specified element.
/// A 32-bit integer that represents the position of the element to set.
/// The current does not have exactly one dimension.
///
/// cannot be cast to the element type of the current .
///
/// is outside the range of valid indexes for the current .
/// 1
// Token: 0x06000421 RID: 1057 RVA: 0x0001033C File Offset: 0x0000E53C
public void SetValue(object value, int index)
{
if (this.Rank != 1)
{
throw new ArgumentException(Locale.GetText("Array was not a one-dimensional array."));
}
if (index < this.GetLowerBound(0) || index > this.GetUpperBound(0))
{
throw new IndexOutOfRangeException(Locale.GetText("Index has to be >= lower bound and <= upper bound of the array."));
}
this.SetValueImpl(value, index - this.GetLowerBound(0));
}
/// Sets a value to the element at the specified position in the two-dimensional . The indexes are specified as 32-bit integers.
/// The new value for the specified element.
/// A 32-bit integer that represents the first-dimension index of the element to set.
/// A 32-bit integer that represents the second-dimension index of the element to set.
/// The current does not have exactly two dimensions.
///
/// cannot be cast to the element type of the current .
/// Either or is outside the range of valid indexes for the corresponding dimension of the current .
/// 1
// Token: 0x06000422 RID: 1058 RVA: 0x000103A0 File Offset: 0x0000E5A0
public void SetValue(object value, int index1, int index2)
{
int[] array = new int[] { index1, index2 };
this.SetValue(value, array);
}
/// Sets a value to the element at the specified position in the three-dimensional . The indexes are specified as 32-bit integers.
/// The new value for the specified element.
/// A 32-bit integer that represents the first-dimension index of the element to set.
/// A 32-bit integer that represents the second-dimension index of the element to set.
/// A 32-bit integer that represents the third-dimension index of the element to set.
/// The current does not have exactly three dimensions.
///
/// cannot be cast to the element type of the current .
///
/// or or is outside the range of valid indexes for the corresponding dimension of the current .
/// 1
// Token: 0x06000423 RID: 1059 RVA: 0x000103C4 File Offset: 0x0000E5C4
public void SetValue(object value, int index1, int index2, int index3)
{
int[] array = new int[] { index1, index2, index3 };
this.SetValue(value, array);
}
/// Creates a one-dimensional of the specified and length, with zero-based indexing.
/// A new one-dimensional of the specified with the specified length, using zero-based indexing.
/// The of the to create.
/// The size of the to create.
///
/// is null.
///
/// is not a valid .
///
/// is not supported. For example, is not supported.-or- is an open generic type.
///
/// is less than zero.
/// 1
// Token: 0x06000424 RID: 1060 RVA: 0x000103F0 File Offset: 0x0000E5F0
public static Array CreateInstance(Type elementType, int length)
{
int[] array = new int[] { length };
return Array.CreateInstance(elementType, array);
}
/// Creates a two-dimensional of the specified and dimension lengths, with zero-based indexing.
/// A new two-dimensional of the specified with the specified length for each dimension, using zero-based indexing.
/// The of the to create.
/// The size of the first dimension of the to create.
/// The size of the second dimension of the to create.
///
/// is null.
///
/// is not a valid .
///
/// is not supported. For example, is not supported. -or- is an open generic type.
///
/// is less than zero.-or- is less than zero.
/// 1
// Token: 0x06000425 RID: 1061 RVA: 0x00010410 File Offset: 0x0000E610
public static Array CreateInstance(Type elementType, int length1, int length2)
{
int[] array = new int[] { length1, length2 };
return Array.CreateInstance(elementType, array);
}
/// Creates a three-dimensional of the specified and dimension lengths, with zero-based indexing.
/// A new three-dimensional of the specified with the specified length for each dimension, using zero-based indexing.
/// The of the to create.
/// The size of the first dimension of the to create.
/// The size of the second dimension of the to create.
/// The size of the third dimension of the to create.
///
/// is null.
///
/// is not a valid .
///
/// is not supported. For example, is not supported. -or- is an open generic type.
///
/// is less than zero.-or- is less than zero.-or- is less than zero.
/// 1
// Token: 0x06000426 RID: 1062 RVA: 0x00010434 File Offset: 0x0000E634
public static Array CreateInstance(Type elementType, int length1, int length2, int length3)
{
int[] array = new int[] { length1, length2, length3 };
return Array.CreateInstance(elementType, array);
}
/// Creates a multidimensional of the specified and dimension lengths, with zero-based indexing. The dimension lengths are specified in an array of 32-bit integers.
/// A new multidimensional of the specified with the specified length for each dimension, using zero-based indexing.
/// The of the to create.
/// An array of 32-bit integers that represent the size of each dimension of the to create.
///
/// is null.-or- is null.
///
/// is not a valid .-or-The array contains less than one element.
///
/// is not supported. For example, is not supported. -or- is an open generic type.
/// Any value in is less than zero.
/// 1
// Token: 0x06000427 RID: 1063 RVA: 0x0001045C File Offset: 0x0000E65C
public static Array CreateInstance(Type elementType, params int[] lengths)
{
if (elementType == null)
{
throw new ArgumentNullException("elementType");
}
if (lengths == null)
{
throw new ArgumentNullException("lengths");
}
if (lengths.Length > 255)
{
throw new TypeLoadException();
}
int[] array = null;
elementType = elementType.UnderlyingSystemType;
if (!elementType.IsSystemType)
{
throw new ArgumentException("Type must be a type provided by the runtime.", "elementType");
}
if (elementType.Equals(typeof(void)))
{
throw new NotSupportedException("Array type can not be void");
}
if (elementType.ContainsGenericParameters)
{
throw new NotSupportedException("Array type can not be an open generic type");
}
return Array.CreateInstanceImpl(elementType, lengths, array);
}
/// Creates a multidimensional of the specified and dimension lengths, with the specified lower bounds.
/// A new multidimensional of the specified with the specified length and lower bound for each dimension.
/// The of the to create.
/// A one-dimensional array that contains the size of each dimension of the to create.
/// A one-dimensional array that contains the lower bound (starting index) of each dimension of the to create.
///
/// is null.-or- is null.-or- is null.
///
/// is not a valid .-or-The array contains less than one element.-or-The and arrays do not contain the same number of elements.
///
/// is not supported. For example, is not supported. -or- is an open generic type.
/// Any value in is less than zero.-or-Any value in is very large, such that the sum of a dimension's lower bound and length is greater than .
/// 1
// Token: 0x06000428 RID: 1064 RVA: 0x00010504 File Offset: 0x0000E704
public static Array CreateInstance(Type elementType, int[] lengths, int[] lowerBounds)
{
if (elementType == null)
{
throw new ArgumentNullException("elementType");
}
if (lengths == null)
{
throw new ArgumentNullException("lengths");
}
if (lowerBounds == null)
{
throw new ArgumentNullException("lowerBounds");
}
elementType = elementType.UnderlyingSystemType;
if (!elementType.IsSystemType)
{
throw new ArgumentException("Type must be a type provided by the runtime.", "elementType");
}
if (elementType.Equals(typeof(void)))
{
throw new NotSupportedException("Array type can not be void");
}
if (elementType.ContainsGenericParameters)
{
throw new NotSupportedException("Array type can not be an open generic type");
}
if (lengths.Length < 1)
{
throw new ArgumentException(Locale.GetText("Arrays must contain >= 1 elements."));
}
if (lengths.Length != lowerBounds.Length)
{
throw new ArgumentException(Locale.GetText("Arrays must be of same size."));
}
for (int i = 0; i < lowerBounds.Length; i++)
{
if (lengths[i] < 0)
{
throw new ArgumentOutOfRangeException("lengths", Locale.GetText("Each value has to be >= 0."));
}
if ((long)lowerBounds[i] + (long)lengths[i] > 2147483647L)
{
throw new ArgumentOutOfRangeException("lengths", Locale.GetText("Length + bound must not exceed Int32.MaxValue."));
}
}
if (lengths.Length > 255)
{
throw new TypeLoadException();
}
return Array.CreateInstanceImpl(elementType, lengths, lowerBounds);
}
// Token: 0x06000429 RID: 1065 RVA: 0x00010648 File Offset: 0x0000E848
private static int[] GetIntArray(long[] values)
{
int num = values.Length;
int[] array = new int[num];
for (int i = 0; i < num; i++)
{
long num2 = values[i];
if (num2 < 0L || num2 > 2147483647L)
{
throw new ArgumentOutOfRangeException("values", Locale.GetText("Each value has to be >= 0 and <= Int32.MaxValue."));
}
array[i] = (int)num2;
}
return array;
}
/// Creates a multidimensional of the specified and dimension lengths, with zero-based indexing. The dimension lengths are specified in an array of 64-bit integers.
/// A new multidimensional of the specified with the specified length for each dimension, using zero-based indexing.
/// The of the to create.
/// An array of 64-bit integers that represent the size of each dimension of the to create. Each integer in the array must be between zero and , inclusive.
///
/// is null.-or- is null.
///
/// is not a valid .-or-The array contains less than one element.
///
/// is not supported. For example, is not supported. -or- is an open generic type.
/// Any value in is less than zero or greater than .
/// 1
// Token: 0x0600042A RID: 1066 RVA: 0x000106A8 File Offset: 0x0000E8A8
public static Array CreateInstance(Type elementType, params long[] lengths)
{
if (lengths == null)
{
throw new ArgumentNullException("lengths");
}
return Array.CreateInstance(elementType, Array.GetIntArray(lengths));
}
/// Gets the value at the specified position in the multidimensional . The indexes are specified as an array of 64-bit integers.
/// The value at the specified position in the multidimensional .
/// A one-dimensional array of 64-bit integers that represent the indexes specifying the position of the element to get.
///
/// is null.
/// The number of dimensions in the current is not equal to the number of elements in .
/// Any element in is outside the range of valid indexes for the corresponding dimension of the current .
/// 2
// Token: 0x0600042B RID: 1067 RVA: 0x000106C8 File Offset: 0x0000E8C8
[ComVisible(false)]
public object GetValue(params long[] indices)
{
if (indices == null)
{
throw new ArgumentNullException("indices");
}
return this.GetValue(Array.GetIntArray(indices));
}
/// Sets a value to the element at the specified position in the multidimensional . The indexes are specified as an array of 64-bit integers.
/// The new value for the specified element.
/// A one-dimensional array of 64-bit integers that represent the indexes specifying the position of the element to set.
///
/// is null.
/// The number of dimensions in the current is not equal to the number of elements in .
///
/// cannot be cast to the element type of the current .
/// Any element in is outside the range of valid indexes for the corresponding dimension of the current .
/// 1
// Token: 0x0600042C RID: 1068 RVA: 0x000106E8 File Offset: 0x0000E8E8
[ComVisible(false)]
public void SetValue(object value, params long[] indices)
{
if (indices == null)
{
throw new ArgumentNullException("indices");
}
this.SetValue(value, Array.GetIntArray(indices));
}
/// Searches an entire one-dimensional sorted for a specific element, using the interface implemented by each element of the and by the specified object.
/// The index of the specified in the specified , if is found. If is not found and is less than one or more elements in , a negative number which is the bitwise complement of the index of the first element that is larger than . If is not found and is greater than any of the elements in , a negative number which is the bitwise complement of (the index of the last element plus 1).
/// The sorted one-dimensional to search.
/// The object to search for.
///
/// is null.
///
/// is multidimensional.
///
/// is of a type that is not compatible with the elements of .
///
/// does not implement the interface, and the search encounters an element that does not implement the interface.
/// 1
// Token: 0x0600042D RID: 1069 RVA: 0x00010708 File Offset: 0x0000E908
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int BinarySearch(Array array, object value)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (value == null)
{
return -1;
}
if (array.Rank > 1)
{
throw new RankException(Locale.GetText("Only single dimension arrays are supported."));
}
if (array.Length == 0)
{
return -1;
}
if (!(value is IComparable))
{
throw new ArgumentException(Locale.GetText("value does not support IComparable."));
}
return Array.DoBinarySearch(array, array.GetLowerBound(0), array.GetLength(0), value, null);
}
/// Searches an entire one-dimensional sorted for a value using the specified interface.
/// The index of the specified in the specified , if is found. If is not found and is less than one or more elements in , a negative number which is the bitwise complement of the index of the first element that is larger than . If is not found and is greater than any of the elements in , a negative number which is the bitwise complement of (the index of the last element plus 1).
/// The sorted one-dimensional to search.
/// The object to search for.
/// The implementation to use when comparing elements.-or- null to use the implementation of each element.
///
/// is null.
///
/// is multidimensional.
///
/// is null, and is of a type that is not compatible with the elements of .
///
/// is null, does not implement the interface, and the search encounters an element that does not implement the interface.
/// 1
// Token: 0x0600042E RID: 1070 RVA: 0x00010788 File Offset: 0x0000E988
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int BinarySearch(Array array, object value, IComparer comparer)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (array.Rank > 1)
{
throw new RankException(Locale.GetText("Only single dimension arrays are supported."));
}
if (array.Length == 0)
{
return -1;
}
if (comparer == null && value != null && !(value is IComparable))
{
throw new ArgumentException(Locale.GetText("comparer is null and value does not support IComparable."));
}
return Array.DoBinarySearch(array, array.GetLowerBound(0), array.GetLength(0), value, comparer);
}
/// Searches a range of elements in a one-dimensional sorted for a value, using the interface implemented by each element of the and by the specified value.
/// The index of the specified in the specified , if is found. If is not found and is less than one or more elements in , a negative number which is the bitwise complement of the index of the first element that is larger than . If is not found and is greater than any of the elements in , a negative number which is the bitwise complement of (the index of the last element plus 1).
/// The sorted one-dimensional to search.
/// The starting index of the range to search.
/// The length of the range to search.
/// The object to search for.
///
/// is null.
///
/// is multidimensional.
///
/// is less than the lower bound of .-or- is less than zero.
///
/// and do not specify a valid range in .-or- is of a type that is not compatible with the elements of .
///
/// does not implement the interface, and the search encounters an element that does not implement the interface.
/// 1
// Token: 0x0600042F RID: 1071 RVA: 0x0001080C File Offset: 0x0000EA0C
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int BinarySearch(Array array, int index, int length, object value)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (array.Rank > 1)
{
throw new RankException(Locale.GetText("Only single dimension arrays are supported."));
}
if (index < array.GetLowerBound(0))
{
throw new ArgumentOutOfRangeException("index", Locale.GetText("index is less than the lower bound of array."));
}
if (length < 0)
{
throw new ArgumentOutOfRangeException("length", Locale.GetText("Value has to be >= 0."));
}
if (index > array.GetLowerBound(0) + array.GetLength(0) - length)
{
throw new ArgumentException(Locale.GetText("index and length do not specify a valid range in array."));
}
if (array.Length == 0)
{
return -1;
}
if (value != null && !(value is IComparable))
{
throw new ArgumentException(Locale.GetText("value does not support IComparable"));
}
return Array.DoBinarySearch(array, index, length, value, null);
}
/// Searches a range of elements in a one-dimensional sorted for a value, using the specified interface.
/// The index of the specified in the specified , if is found. If is not found and is less than one or more elements in , a negative number which is the bitwise complement of the index of the first element that is larger than . If is not found and is greater than any of the elements in , a negative number which is the bitwise complement of (the index of the last element plus 1).
/// The sorted one-dimensional to search.
/// The starting index of the range to search.
/// The length of the range to search.
/// The object to search for.
/// The implementation to use when comparing elements.-or- null to use the implementation of each element.
///
/// is null.
///
/// is multidimensional.
///
/// is less than the lower bound of .-or- is less than zero.
///
/// and do not specify a valid range in .-or- is null, and is of a type that is not compatible with the elements of .
///
/// is null, does not implement the interface, and the search encounters an element that does not implement the interface.
/// 1
// Token: 0x06000430 RID: 1072 RVA: 0x000108E4 File Offset: 0x0000EAE4
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int BinarySearch(Array array, int index, int length, object value, IComparer comparer)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (array.Rank > 1)
{
throw new RankException(Locale.GetText("Only single dimension arrays are supported."));
}
if (index < array.GetLowerBound(0))
{
throw new ArgumentOutOfRangeException("index", Locale.GetText("index is less than the lower bound of array."));
}
if (length < 0)
{
throw new ArgumentOutOfRangeException("length", Locale.GetText("Value has to be >= 0."));
}
if (index > array.GetLowerBound(0) + array.GetLength(0) - length)
{
throw new ArgumentException(Locale.GetText("index and length do not specify a valid range in array."));
}
if (array.Length == 0)
{
return -1;
}
if (comparer == null && value != null && !(value is IComparable))
{
throw new ArgumentException(Locale.GetText("comparer is null and value does not support IComparable."));
}
return Array.DoBinarySearch(array, index, length, value, comparer);
}
// Token: 0x06000431 RID: 1073 RVA: 0x000109C4 File Offset: 0x0000EBC4
private static int DoBinarySearch(Array array, int index, int length, object value, IComparer comparer)
{
if (comparer == null)
{
comparer = Comparer.Default;
}
int i = index;
int num = index + length - 1;
try
{
while (i <= num)
{
int num2 = i + (num - i) / 2;
object valueImpl = array.GetValueImpl(num2);
int num3 = comparer.Compare(valueImpl, value);
if (num3 == 0)
{
return num2;
}
if (num3 > 0)
{
num = num2 - 1;
}
else
{
i = num2 + 1;
}
}
}
catch (Exception ex)
{
throw new InvalidOperationException(Locale.GetText("Comparer threw an exception."), ex);
}
return ~i;
}
/// Sets a range of elements in the to zero, to false, or to null, depending on the element type.
/// The whose elements need to be cleared.
/// The starting index of the range of elements to clear.
/// The number of elements to clear.
///
/// is null.
///
/// is less than the lower bound of .-or- is less than zero.-or-The sum of and is greater than the size of the .
/// 1
// Token: 0x06000432 RID: 1074 RVA: 0x00010A74 File Offset: 0x0000EC74
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public static void Clear(Array array, int index, int length)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (length < 0)
{
throw new IndexOutOfRangeException("length < 0");
}
int lowerBound = array.GetLowerBound(0);
if (index < lowerBound)
{
throw new IndexOutOfRangeException("index < lower bound");
}
index -= lowerBound;
if (index > array.Length - length)
{
throw new IndexOutOfRangeException("index + length > size");
}
Array.ClearInternal(array, index, length);
}
// Token: 0x06000433 RID: 1075
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void ClearInternal(Array a, int index, int count);
/// Creates a shallow copy of the .
/// A shallow copy of the .
/// 1
// Token: 0x06000434 RID: 1076
[MethodImpl(MethodImplOptions.InternalCall)]
public extern object Clone();
/// Copies a range of elements from an starting at the first element and pastes them into another starting at the first element. The length is specified as a 32-bit integer.
/// The that contains the data to copy.
/// The that receives the data.
/// A 32-bit integer that represents the number of elements to copy.
///
/// is null.-or- is null.
///
/// and have different ranks.
///
/// and are of incompatible types.
/// At least one element in cannot be cast to the type of .
///
/// is less than zero.
///
/// is greater than the number of elements in .-or- is greater than the number of elements in .
/// 1
// Token: 0x06000435 RID: 1077 RVA: 0x00010AE4 File Offset: 0x0000ECE4
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Copy(Array sourceArray, Array destinationArray, int length)
{
if (sourceArray == null)
{
throw new ArgumentNullException("sourceArray");
}
if (destinationArray == null)
{
throw new ArgumentNullException("destinationArray");
}
Array.Copy(sourceArray, sourceArray.GetLowerBound(0), destinationArray, destinationArray.GetLowerBound(0), length);
}
/// Copies a range of elements from an starting at the specified source index and pastes them to another starting at the specified destination index. The length and the indexes are specified as 32-bit integers.
/// The that contains the data to copy.
/// A 32-bit integer that represents the index in the at which copying begins.
/// The that receives the data.
/// A 32-bit integer that represents the index in the at which storing begins.
/// A 32-bit integer that represents the number of elements to copy.
///
/// is null.-or- is null.
///
/// and have different ranks.
///
/// and are of incompatible types.
/// At least one element in cannot be cast to the type of .
///
/// is less than the lower bound of the first dimension of .-or- is less than the lower bound of the first dimension of .-or- is less than zero.
///
/// is greater than the number of elements from to the end of .-or- is greater than the number of elements from to the end of .
/// 1
// Token: 0x06000436 RID: 1078 RVA: 0x00010B2C File Offset: 0x0000ED2C
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Copy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length)
{
if (sourceArray == null)
{
throw new ArgumentNullException("sourceArray");
}
if (destinationArray == null)
{
throw new ArgumentNullException("destinationArray");
}
if (length < 0)
{
throw new ArgumentOutOfRangeException("length", Locale.GetText("Value has to be >= 0."));
}
if (sourceIndex < 0)
{
throw new ArgumentOutOfRangeException("sourceIndex", Locale.GetText("Value has to be >= 0."));
}
if (destinationIndex < 0)
{
throw new ArgumentOutOfRangeException("destinationIndex", Locale.GetText("Value has to be >= 0."));
}
if (Array.FastCopy(sourceArray, sourceIndex, destinationArray, destinationIndex, length))
{
return;
}
int num = sourceIndex - sourceArray.GetLowerBound(0);
int num2 = destinationIndex - destinationArray.GetLowerBound(0);
if (num > sourceArray.Length - length)
{
throw new ArgumentException("length");
}
if (num2 > destinationArray.Length - length)
{
string text = "Destination array was not long enough. Check destIndex and length, and the array's lower bounds";
throw new ArgumentException(text, string.Empty);
}
if (sourceArray.Rank != destinationArray.Rank)
{
throw new RankException(Locale.GetText("Arrays must be of same size."));
}
Type elementType = sourceArray.GetType().GetElementType();
Type elementType2 = destinationArray.GetType().GetElementType();
if (!object.ReferenceEquals(sourceArray, destinationArray) || num > num2)
{
for (int i = 0; i < length; i++)
{
object valueImpl = sourceArray.GetValueImpl(num + i);
try
{
destinationArray.SetValueImpl(valueImpl, num2 + i);
}
catch
{
if (elementType.Equals(typeof(object)))
{
throw new InvalidCastException();
}
throw new ArrayTypeMismatchException(string.Format(Locale.GetText("(Types: source={0}; target={1})"), elementType.FullName, elementType2.FullName));
}
}
}
else
{
for (int j = length - 1; j >= 0; j--)
{
object valueImpl2 = sourceArray.GetValueImpl(num + j);
try
{
destinationArray.SetValueImpl(valueImpl2, num2 + j);
}
catch
{
if (elementType.Equals(typeof(object)))
{
throw new InvalidCastException();
}
throw new ArrayTypeMismatchException(string.Format(Locale.GetText("(Types: source={0}; target={1})"), elementType.FullName, elementType2.FullName));
}
}
}
}
/// Copies a range of elements from an starting at the specified source index and pastes them to another starting at the specified destination index. The length and the indexes are specified as 64-bit integers.
/// The that contains the data to copy.
/// A 64-bit integer that represents the index in the at which copying begins.
/// The that receives the data.
/// A 64-bit integer that represents the index in the at which storing begins.
/// A 64-bit integer that represents the number of elements to copy. The integer must be between zero and , inclusive.
///
/// is null.-or- is null.
///
/// and have different ranks.
///
/// and are of incompatible types.
/// At least one element in cannot be cast to the type of .
///
/// is outside the range of valid indexes for the .-or- is outside the range of valid indexes for the .-or- is less than 0 or greater than .
///
/// is greater than the number of elements from to the end of .-or- is greater than the number of elements from to the end of .
/// 1
// Token: 0x06000437 RID: 1079 RVA: 0x00010D88 File Offset: 0x0000EF88
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Copy(Array sourceArray, long sourceIndex, Array destinationArray, long destinationIndex, long length)
{
if (sourceArray == null)
{
throw new ArgumentNullException("sourceArray");
}
if (destinationArray == null)
{
throw new ArgumentNullException("destinationArray");
}
if (sourceIndex < -2147483648L || sourceIndex > 2147483647L)
{
throw new ArgumentOutOfRangeException("sourceIndex", Locale.GetText("Must be in the Int32 range."));
}
if (destinationIndex < -2147483648L || destinationIndex > 2147483647L)
{
throw new ArgumentOutOfRangeException("destinationIndex", Locale.GetText("Must be in the Int32 range."));
}
if (length < 0L || length > 2147483647L)
{
throw new ArgumentOutOfRangeException("length", Locale.GetText("Value must be >= 0 and <= Int32.MaxValue."));
}
Array.Copy(sourceArray, (int)sourceIndex, destinationArray, (int)destinationIndex, (int)length);
}
/// Copies a range of elements from an starting at the first element and pastes them into another starting at the first element. The length is specified as a 64-bit integer.
/// The that contains the data to copy.
/// The that receives the data.
/// A 64-bit integer that represents the number of elements to copy. The integer must be between zero and , inclusive.
///
/// is null.-or- is null.
///
/// and have different ranks.
///
/// and are of incompatible types.
/// At least one element in cannot be cast to the type of .
///
/// is less than 0 or greater than .
///
/// is greater than the number of elements in .-or- is greater than the number of elements in .
/// 1
// Token: 0x06000438 RID: 1080 RVA: 0x00010E4C File Offset: 0x0000F04C
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Copy(Array sourceArray, Array destinationArray, long length)
{
if (length < 0L || length > 2147483647L)
{
throw new ArgumentOutOfRangeException("length", Locale.GetText("Value must be >= 0 and <= Int32.MaxValue."));
}
Array.Copy(sourceArray, destinationArray, (int)length);
}
/// Searches for the specified object and returns the index of the first occurrence within the entire one-dimensional .
/// The index of the first occurrence of within the entire , if found; otherwise, the lower bound of the array minus 1.
/// The one-dimensional to search.
/// The object to locate in .
///
/// is null.
///
/// is multidimensional.
/// 1
// Token: 0x06000439 RID: 1081 RVA: 0x00010E8C File Offset: 0x0000F08C
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int IndexOf(Array array, object value)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
return Array.IndexOf(array, value, 0, array.Length);
}
/// Searches for the specified object and returns the index of the first occurrence within the range of elements in the one-dimensional that extends from the specified index to the last element.
/// The index of the first occurrence of within the range of elements in that extends from to the last element, if found; otherwise, the lower bound of the array minus 1.
/// The one-dimensional to search.
/// The object to locate in .
/// The starting index of the search. 0 (zero) is valid in an empty array.
///
/// is null.
///
/// is outside the range of valid indexes for .
///
/// is multidimensional.
/// 1
// Token: 0x0600043A RID: 1082 RVA: 0x00010EB0 File Offset: 0x0000F0B0
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int IndexOf(Array array, object value, int startIndex)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
return Array.IndexOf(array, value, startIndex, array.Length - startIndex);
}
/// Searches for the specified object and returns the index of the first occurrence within the range of elements in the one-dimensional that starts at the specified index and contains the specified number of elements.
/// The index of the first occurrence of within the range of elements in that starts at and contains the number of elements specified in , if found; otherwise, the lower bound of the array minus 1.
/// The one-dimensional to search.
/// The object to locate in .
/// The starting index of the search. 0 (zero) is valid in an empty array.
/// The number of elements in the section to search.
///
/// is null.
///
/// is outside the range of valid indexes for .-or- is less than zero.-or- and do not specify a valid section in .
///
/// is multidimensional.
/// 1
// Token: 0x0600043B RID: 1083 RVA: 0x00010ED4 File Offset: 0x0000F0D4
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int IndexOf(Array array, object value, int startIndex, int count)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (array.Rank > 1)
{
throw new RankException(Locale.GetText("Only single dimension arrays are supported."));
}
if (count < 0 || startIndex < array.GetLowerBound(0) || startIndex - 1 > array.GetUpperBound(0) - count)
{
throw new ArgumentOutOfRangeException();
}
int num = startIndex + count;
for (int i = startIndex; i < num; i++)
{
if (object.Equals(array.GetValueImpl(i), value))
{
return i;
}
}
return array.GetLowerBound(0) - 1;
}
/// Initializes every element of the value-type by calling the default constructor of the value type.
/// 2
// Token: 0x0600043C RID: 1084 RVA: 0x00010F6C File Offset: 0x0000F16C
public void Initialize()
{
}
/// Searches for the specified object and returns the index of the last occurrence within the entire one-dimensional .
/// The index of the last occurrence of within the entire , if found; otherwise, the lower bound of the array minus 1.
/// The one-dimensional to search.
/// The object to locate in .
///
/// is null.
///
/// is multidimensional.
/// 1
// Token: 0x0600043D RID: 1085 RVA: 0x00010F70 File Offset: 0x0000F170
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int LastIndexOf(Array array, object value)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (array.Length == 0)
{
return array.GetLowerBound(0) - 1;
}
return Array.LastIndexOf(array, value, array.Length - 1);
}
/// Searches for the specified object and returns the index of the last occurrence within the range of elements in the one-dimensional that extends from the first element to the specified index.
/// The index of the last occurrence of within the range of elements in that extends from the first element to , if found; otherwise, the lower bound of the array minus 1.
/// The one-dimensional to search.
/// The object to locate in .
/// The starting index of the backward search.
///
/// is null.
///
/// is outside the range of valid indexes for .
///
/// is multidimensional.
/// 1
// Token: 0x0600043E RID: 1086 RVA: 0x00010FB4 File Offset: 0x0000F1B4
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int LastIndexOf(Array array, object value, int startIndex)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
return Array.LastIndexOf(array, value, startIndex, startIndex - array.GetLowerBound(0) + 1);
}
/// Searches for the specified object and returns the index of the last occurrence within the range of elements in the one-dimensional that contains the specified number of elements and ends at the specified index.
/// The index of the last occurrence of within the range of elements in that contains the number of elements specified in and ends at , if found; otherwise, the lower bound of the array minus 1.
/// The one-dimensional to search.
/// The object to locate in .
/// The starting index of the backward search.
/// The number of elements in the section to search.
///
/// is null.
///
/// is outside the range of valid indexes for .-or- is less than zero.-or- and do not specify a valid section in .
///
/// is multidimensional.
/// 1
// Token: 0x0600043F RID: 1087 RVA: 0x00010FE8 File Offset: 0x0000F1E8
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int LastIndexOf(Array array, object value, int startIndex, int count)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (array.Rank > 1)
{
throw new RankException(Locale.GetText("Only single dimension arrays are supported."));
}
int lowerBound = array.GetLowerBound(0);
if (array.Length == 0)
{
return lowerBound - 1;
}
if (count < 0 || startIndex < lowerBound || startIndex > array.GetUpperBound(0) || startIndex - count + 1 < lowerBound)
{
throw new ArgumentOutOfRangeException();
}
for (int i = startIndex; i >= startIndex - count + 1; i--)
{
if (object.Equals(array.GetValueImpl(i), value))
{
return i;
}
}
return lowerBound - 1;
}
// Token: 0x06000440 RID: 1088 RVA: 0x00011094 File Offset: 0x0000F294
private static Array.Swapper get_swapper(Array array)
{
if (array is int[])
{
return new Array.Swapper(array.int_swapper);
}
if (array is double[])
{
return new Array.Swapper(array.double_swapper);
}
if (array is object[])
{
return new Array.Swapper(array.obj_swapper);
}
return new Array.Swapper(array.slow_swapper);
}
// Token: 0x06000441 RID: 1089 RVA: 0x000110F8 File Offset: 0x0000F2F8
private static Array.Swapper get_swapper(T[] array)
{
if (array is int[])
{
return new Array.Swapper(array.int_swapper);
}
if (array is double[])
{
return new Array.Swapper(array.double_swapper);
}
return new Array.Swapper(array.slow_swapper);
}
/// Reverses the sequence of the elements in the entire one-dimensional .
/// The one-dimensional to reverse.
///
/// is null.
///
/// is multidimensional.
/// 1
// Token: 0x06000442 RID: 1090 RVA: 0x00011144 File Offset: 0x0000F344
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Reverse(Array array)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
Array.Reverse(array, array.GetLowerBound(0), array.GetLength(0));
}
/// Reverses the sequence of the elements in a range of elements in the one-dimensional .
/// The one-dimensional to reverse.
/// The starting index of the section to reverse.
/// The number of elements in the section to reverse.
///
/// is null.
///
/// is multidimensional.
///
/// is less than the lower bound of .-or- is less than zero.
///
/// and do not specify a valid range in .
/// 1
// Token: 0x06000443 RID: 1091 RVA: 0x0001116C File Offset: 0x0000F36C
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Reverse(Array array, int index, int length)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (array.Rank > 1)
{
throw new RankException(Locale.GetText("Only single dimension arrays are supported."));
}
if (index < array.GetLowerBound(0) || length < 0)
{
throw new ArgumentOutOfRangeException();
}
if (index > array.GetUpperBound(0) + 1 - length)
{
throw new ArgumentException();
}
int num = index + length - 1;
object[] array2 = array as object[];
if (array2 != null)
{
while (index < num)
{
object obj = array2[index];
array2[index] = array2[num];
array2[num] = obj;
index++;
num--;
}
return;
}
int[] array3 = array as int[];
if (array3 != null)
{
while (index < num)
{
int num2 = array3[index];
array3[index] = array3[num];
array3[num] = num2;
index++;
num--;
}
return;
}
double[] array4 = array as double[];
if (array4 != null)
{
while (index < num)
{
double num3 = array4[index];
array4[index] = array4[num];
array4[num] = num3;
index++;
num--;
}
return;
}
Array.Swapper swapper = Array.get_swapper(array);
while (index < num)
{
swapper(index, num);
index++;
num--;
}
}
/// Sorts the elements in an entire one-dimensional using the implementation of each element of the .
/// The one-dimensional to sort.
///
/// is null.
///
/// is multidimensional.
/// One or more elements in do not implement the interface.
/// 1
// Token: 0x06000444 RID: 1092 RVA: 0x000112A0 File Offset: 0x0000F4A0
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Sort(Array array)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
Array.Sort(array, null, array.GetLowerBound(0), array.GetLength(0), null);
}
/// Sorts a pair of one-dimensional objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the implementation of each key.
/// The one-dimensional that contains the keys to sort.
/// The one-dimensional that contains the items that correspond to each of the keys in the .-or-null to sort only the .
///
/// is null.
/// The is multidimensional.-or-The is multidimensional.
///
/// is not null, and the lower bound of does not match the lower bound of .-or- is not null, and the length of is greater than the length of .
/// One or more elements in the do not implement the interface.
/// 1
// Token: 0x06000445 RID: 1093 RVA: 0x000112D4 File Offset: 0x0000F4D4
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Sort(Array keys, Array items)
{
if (keys == null)
{
throw new ArgumentNullException("keys");
}
Array.Sort(keys, items, keys.GetLowerBound(0), keys.GetLength(0), null);
}
/// Sorts the elements in a one-dimensional using the specified .
/// The one-dimensional to sort.
/// The implementation to use when comparing elements.-or-null to use the implementation of each element.
///
/// is null.
///
/// is multidimensional.
///
/// is null, and one or more elements in do not implement the interface.
/// The implementation of caused an error during the sort. For example, might not return 0 when comparing an item with itself.
/// 1
// Token: 0x06000446 RID: 1094 RVA: 0x00011308 File Offset: 0x0000F508
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Sort(Array array, IComparer comparer)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
Array.Sort(array, null, array.GetLowerBound(0), array.GetLength(0), comparer);
}
/// Sorts the elements in a range of elements in a one-dimensional using the implementation of each element of the .
/// The one-dimensional to sort.
/// The starting index of the range to sort.
/// The number of elements in the range to sort.
///
/// is null.
///
/// is multidimensional.
///
/// is less than the lower bound of .-or- is less than zero.
///
/// and do not specify a valid range in .
/// One or more elements in do not implement the interface.
/// 1
// Token: 0x06000447 RID: 1095 RVA: 0x0001133C File Offset: 0x0000F53C
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Sort(Array array, int index, int length)
{
Array.Sort(array, null, index, length, null);
}
/// Sorts a pair of one-dimensional objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the specified .
/// The one-dimensional that contains the keys to sort.
/// The one-dimensional that contains the items that correspond to each of the keys in the .-or-null to sort only the .
/// The implementation to use when comparing elements.-or-null to use the implementation of each element.
///
/// is null.
/// The is multidimensional.-or-The is multidimensional.
///
/// is not null, and the lower bound of does not match the lower bound of .-or- is not null, and the length of is greater than the length of . -or-The implementation of caused an error during the sort. For example, might not return 0 when comparing an item with itself.
///
/// is null, and one or more elements in the do not implement the interface.
/// 1
// Token: 0x06000448 RID: 1096 RVA: 0x00011348 File Offset: 0x0000F548
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Sort(Array keys, Array items, IComparer comparer)
{
if (keys == null)
{
throw new ArgumentNullException("keys");
}
Array.Sort(keys, items, keys.GetLowerBound(0), keys.GetLength(0), comparer);
}
/// Sorts a range of elements in a pair of one-dimensional objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the implementation of each key.
/// The one-dimensional that contains the keys to sort.
/// The one-dimensional that contains the items that correspond to each of the keys in the .-or-null to sort only the .
/// The starting index of the range to sort.
/// The number of elements in the range to sort.
///
/// is null.
/// The is multidimensional.-or-The is multidimensional.
///
/// is less than the lower bound of .-or- is less than zero.
///
/// is not null, and the lower bound of does not match the lower bound of .-or- is not null, and the length of is greater than the length of .-or- and do not specify a valid range in the .-or- is not null, and and do not specify a valid range in the .
/// One or more elements in the do not implement the interface.
/// 1
// Token: 0x06000449 RID: 1097 RVA: 0x0001137C File Offset: 0x0000F57C
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Sort(Array keys, Array items, int index, int length)
{
Array.Sort(keys, items, index, length, null);
}
/// Sorts the elements in a range of elements in a one-dimensional using the specified .
/// The one-dimensional to sort.
/// The starting index of the range to sort.
/// The number of elements in the range to sort.
/// The implementation to use when comparing elements.-or-null to use the implementation of each element.
///
/// is null.
///
/// is multidimensional.
///
/// is less than the lower bound of .-or- is less than zero.
///
/// and do not specify a valid range in . -or-The implementation of caused an error during the sort. For example, might not return 0 when comparing an item with itself.
///
/// is null, and one or more elements in do not implement the interface.
/// 1
// Token: 0x0600044A RID: 1098 RVA: 0x00011388 File Offset: 0x0000F588
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Sort(Array array, int index, int length, IComparer comparer)
{
Array.Sort(array, null, index, length, comparer);
}
/// Sorts a range of elements in a pair of one-dimensional objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the specified .
/// The one-dimensional that contains the keys to sort.
/// The one-dimensional that contains the items that correspond to each of the keys in the .-or-null to sort only the .
/// The starting index of the range to sort.
/// The number of elements in the range to sort.
/// The implementation to use when comparing elements.-or-null to use the implementation of each element.
///
/// is null.
/// The is multidimensional.-or-The is multidimensional.
///
/// is less than the lower bound of .-or- is less than zero.
///
/// is not null, and the lower bound of does not match the lower bound of .-or- is not null, and the length of is greater than the length of .-or- and do not specify a valid range in the .-or- is not null, and and do not specify a valid range in the . -or-The implementation of caused an error during the sort. For example, might not return 0 when comparing an item with itself.
///
/// is null, and one or more elements in the do not implement the interface.
/// 1
// Token: 0x0600044B RID: 1099 RVA: 0x00011394 File Offset: 0x0000F594
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Sort(Array keys, Array items, int index, int length, IComparer comparer)
{
if (keys == null)
{
throw new ArgumentNullException("keys");
}
if (keys.Rank > 1 || (items != null && items.Rank > 1))
{
throw new RankException();
}
if (items != null && keys.GetLowerBound(0) != items.GetLowerBound(0))
{
throw new ArgumentException();
}
if (index < keys.GetLowerBound(0))
{
throw new ArgumentOutOfRangeException("index");
}
if (length < 0)
{
throw new ArgumentOutOfRangeException("length", Locale.GetText("Value has to be >= 0."));
}
if (keys.Length - (index + keys.GetLowerBound(0)) < length || (items != null && index > items.Length - length))
{
throw new ArgumentException();
}
if (length <= 1)
{
return;
}
if (comparer == null)
{
Array.Swapper swapper;
if (items == null)
{
swapper = null;
}
else
{
swapper = Array.get_swapper(items);
}
if (keys is double[])
{
Array.combsort(keys as double[], index, length, swapper);
return;
}
if (!(keys is uint[]) && keys is int[])
{
Array.combsort(keys as int[], index, length, swapper);
return;
}
if (keys is char[])
{
Array.combsort(keys as char[], index, length, swapper);
return;
}
}
try
{
int num = index + length - 1;
Array.qsort(keys, items, index, num, comparer);
}
catch (Exception ex)
{
throw new InvalidOperationException(Locale.GetText("The comparer threw an exception."), ex);
}
}
// Token: 0x0600044C RID: 1100 RVA: 0x00011520 File Offset: 0x0000F720
private void int_swapper(int i, int j)
{
int[] array = this as int[];
int num = array[i];
array[i] = array[j];
array[j] = num;
}
// Token: 0x0600044D RID: 1101 RVA: 0x00011544 File Offset: 0x0000F744
private void obj_swapper(int i, int j)
{
object[] array = this as object[];
object obj = array[i];
array[i] = array[j];
array[j] = obj;
}
// Token: 0x0600044E RID: 1102 RVA: 0x00011568 File Offset: 0x0000F768
private void slow_swapper(int i, int j)
{
object valueImpl = this.GetValueImpl(i);
this.SetValueImpl(this.GetValue(j), i);
this.SetValueImpl(valueImpl, j);
}
// Token: 0x0600044F RID: 1103 RVA: 0x00011594 File Offset: 0x0000F794
private void double_swapper(int i, int j)
{
double[] array = this as double[];
double num = array[i];
array[i] = array[j];
array[j] = num;
}
// Token: 0x06000450 RID: 1104 RVA: 0x000115B8 File Offset: 0x0000F7B8
private static int new_gap(int gap)
{
gap = gap * 10 / 13;
if (gap == 9 || gap == 10)
{
return 11;
}
if (gap < 1)
{
return 1;
}
return gap;
}
// Token: 0x06000451 RID: 1105 RVA: 0x000115EC File Offset: 0x0000F7EC
private static void combsort(double[] array, int start, int size, Array.Swapper swap_items)
{
int num = size;
bool flag;
do
{
num = Array.new_gap(num);
flag = false;
int num2 = start + size - num;
for (int i = start; i < num2; i++)
{
int num3 = i + num;
if (array[i] > array[num3])
{
double num4 = array[i];
array[i] = array[num3];
array[num3] = num4;
flag = true;
if (swap_items != null)
{
swap_items(i, num3);
}
}
}
}
while (num != 1 || flag);
}
// Token: 0x06000452 RID: 1106 RVA: 0x00011668 File Offset: 0x0000F868
private static void combsort(int[] array, int start, int size, Array.Swapper swap_items)
{
int num = size;
bool flag;
do
{
num = Array.new_gap(num);
flag = false;
int num2 = start + size - num;
for (int i = start; i < num2; i++)
{
int num3 = i + num;
if (array[i] > array[num3])
{
int num4 = array[i];
array[i] = array[num3];
array[num3] = num4;
flag = true;
if (swap_items != null)
{
swap_items(i, num3);
}
}
}
}
while (num != 1 || flag);
}
// Token: 0x06000453 RID: 1107 RVA: 0x000116E4 File Offset: 0x0000F8E4
private static void combsort(char[] array, int start, int size, Array.Swapper swap_items)
{
int num = size;
bool flag;
do
{
num = Array.new_gap(num);
flag = false;
int num2 = start + size - num;
for (int i = start; i < num2; i++)
{
int num3 = i + num;
if (array[i] > array[num3])
{
char c = array[i];
array[i] = array[num3];
array[num3] = c;
flag = true;
if (swap_items != null)
{
swap_items(i, num3);
}
}
}
}
while (num != 1 || flag);
}
// Token: 0x06000454 RID: 1108 RVA: 0x00011760 File Offset: 0x0000F960
private static void qsort(Array keys, Array items, int low0, int high0, IComparer comparer)
{
if (low0 >= high0)
{
return;
}
int num = low0;
int num2 = high0;
int num3 = num + (num2 - num) / 2;
object valueImpl = keys.GetValueImpl(num3);
for (;;)
{
while (num < high0 && Array.compare(keys.GetValueImpl(num), valueImpl, comparer) < 0)
{
num++;
}
while (num2 > low0 && Array.compare(valueImpl, keys.GetValueImpl(num2), comparer) < 0)
{
num2--;
}
if (num > num2)
{
break;
}
Array.swap(keys, items, num, num2);
num++;
num2--;
}
if (low0 < num2)
{
Array.qsort(keys, items, low0, num2, comparer);
}
if (num < high0)
{
Array.qsort(keys, items, num, high0, comparer);
}
}
// Token: 0x06000455 RID: 1109 RVA: 0x00011820 File Offset: 0x0000FA20
private static void swap(Array keys, Array items, int i, int j)
{
object obj = keys.GetValueImpl(i);
keys.SetValueImpl(keys.GetValue(j), i);
keys.SetValueImpl(obj, j);
if (items != null)
{
obj = items.GetValueImpl(i);
items.SetValueImpl(items.GetValueImpl(j), i);
items.SetValueImpl(obj, j);
}
}
// Token: 0x06000456 RID: 1110 RVA: 0x00011870 File Offset: 0x0000FA70
private static int compare(object value1, object value2, IComparer comparer)
{
if (value1 == null)
{
return (value2 != null) ? (-1) : 0;
}
if (value2 == null)
{
return 1;
}
if (comparer == null)
{
return ((IComparable)value1).CompareTo(value2);
}
return comparer.Compare(value1, value2);
}
/// Sorts the elements in an entire using the generic interface implementation of each element of the .
/// The one-dimensional, zero-based to sort.
/// The type of the elements of the array.
///
/// is null.
/// One or more elements in do not implement the generic interface.
// Token: 0x06000457 RID: 1111 RVA: 0x000118B4 File Offset: 0x0000FAB4
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Sort(T[] array)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
Array.Sort(array, null, 0, array.Length, null);
}
/// Sorts a pair of objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the generic interface implementation of each key.
/// The one-dimensional, zero-based that contains the keys to sort.
/// The one-dimensional, zero-based that contains the items that correspond to the keys in , or null to sort only .
/// The type of the elements of the key array.
/// The type of the elements of the items array.
///
/// is null.
///
/// is not null, and the lower bound of does not match the lower bound of .-or- is not null, and the length of is greater than the length of .
/// One or more elements in the do not implement the generic interface.
// Token: 0x06000458 RID: 1112 RVA: 0x000118D4 File Offset: 0x0000FAD4
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Sort(TKey[] keys, TValue[] items)
{
if (keys == null)
{
throw new ArgumentNullException("keys");
}
Array.Sort(keys, items, 0, keys.Length, null);
}
/// Sorts the elements in an using the specified generic interface.
/// The one-dimensional, zero-base to sort
/// The generic interface implementation to use when comparing elements, or null to use the generic interface implementation of each element.
/// The type of the elements of the array.
///
/// is null.
///
/// is null, and one or more elements in do not implement the generic interface.
/// The implementation of caused an error during the sort. For example, might not return 0 when comparing an item with itself.
// Token: 0x06000459 RID: 1113 RVA: 0x000118F4 File Offset: 0x0000FAF4
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Sort(T[] array, IComparer comparer)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
Array.Sort(array, null, 0, array.Length, comparer);
}
/// Sorts a pair of objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the specified generic interface.
/// The one-dimensional, zero-based that contains the keys to sort.
/// The one-dimensional, zero-based that contains the items that correspond to the keys in , or null to sort only .
/// The generic interface implementation to use when comparing elements, or null to use the generic interface implementation of each element.
/// The type of the elements of the key array.
/// The type of the elements of the items array.
///
/// is null.
///
/// is not null, and the lower bound of does not match the lower bound of .-or- is not null, and the length of is greater than the length of .-or-The implementation of caused an error during the sort. For example, might not return 0 when comparing an item with itself.
///
/// is null, and one or more elements in the do not implement the generic interface.
// Token: 0x0600045A RID: 1114 RVA: 0x00011914 File Offset: 0x0000FB14
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Sort(TKey[] keys, TValue[] items, IComparer comparer)
{
if (keys == null)
{
throw new ArgumentNullException("keys");
}
Array.Sort(keys, items, 0, keys.Length, comparer);
}
/// Sorts the elements in a range of elements in an using the generic interface implementation of each element of the .
/// The one-dimensional, zero-based to sort
/// The starting index of the range to sort.
/// The number of elements in the range to sort.
/// The type of the elements of the array.
///
/// is null.
///
/// is less than the lower bound of .-or- is less than zero.
///
/// and do not specify a valid range in .
/// One or more elements in do not implement the generic interface.
// Token: 0x0600045B RID: 1115 RVA: 0x00011934 File Offset: 0x0000FB34
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Sort(T[] array, int index, int length)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
Array.Sort(array, null, index, length, null);
}
/// Sorts a range of elements in a pair of objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the generic interface implementation of each key.
/// The one-dimensional, zero-based that contains the keys to sort.
/// The one-dimensional, zero-based that contains the items that correspond to the keys in , or null to sort only .
/// The starting index of the range to sort.
/// The number of elements in the range to sort.
/// The type of the elements of the key array.
/// The type of the elements of the items array.
///
/// is null.
///
/// is less than the lower bound of .-or- is less than zero.
///
/// is not null, and the lower bound of does not match the lower bound of .-or- is not null, and the length of is greater than the length of .-or- and do not specify a valid range in the .-or- is not null, and and do not specify a valid range in the .
/// One or more elements in the do not implement the generic interface.
// Token: 0x0600045C RID: 1116 RVA: 0x00011954 File Offset: 0x0000FB54
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Sort(TKey[] keys, TValue[] items, int index, int length)
{
Array.Sort(keys, items, index, length, null);
}
/// Sorts the elements in a range of elements in an using the specified generic interface.
/// The one-dimensional, zero-based to sort.
/// The starting index of the range to sort.
/// The number of elements in the range to sort.
/// The generic interface implementation to use when comparing elements, or null to use the generic interface implementation of each element.
/// The type of the elements of the array.
///
/// is null.
///
/// is less than the lower bound of .-or- is less than zero.
///
/// and do not specify a valid range in . -or-The implementation of caused an error during the sort. For example, might not return 0 when comparing an item with itself.
///
/// is null, and one or more elements in do not implement the generic interface.
// Token: 0x0600045D RID: 1117 RVA: 0x00011960 File Offset: 0x0000FB60
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Sort(T[] array, int index, int length, IComparer comparer)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
Array.Sort(array, null, index, length, comparer);
}
/// Sorts a range of elements in a pair of objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the specified generic interface.
/// The one-dimensional, zero-based that contains the keys to sort.
/// The one-dimensional, zero-based that contains the items that correspond to the keys in , or null to sort only .
/// The starting index of the range to sort.
/// The number of elements in the range to sort.
/// The generic interface implementation to use when comparing elements, or null to use the generic interface implementation of each element.
/// The type of the elements of the key array.
/// The type of the elements of the items array.
///
/// is null.
///
/// is less than the lower bound of .-or- is less than zero.
///
/// is not null, and the lower bound of does not match the lower bound of .-or- is not null, and the length of is greater than the length of .-or- and do not specify a valid range in the .-or- is not null, and and do not specify a valid range in the . -or-The implementation of caused an error during the sort. For example, might not return 0 when comparing an item with itself.
///
/// is null, and one or more elements in the do not implement the generic interface.
// Token: 0x0600045E RID: 1118 RVA: 0x00011980 File Offset: 0x0000FB80
[ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Sort(TKey[] keys, TValue[] items, int index, int length, IComparer comparer)
{
if (keys == null)
{
throw new ArgumentNullException("keys");
}
if (index < 0)
{
throw new ArgumentOutOfRangeException("index");
}
if (length < 0)
{
throw new ArgumentOutOfRangeException("length");
}
if (keys.Length - index < length || (items != null && index > items.Length - length))
{
throw new ArgumentException();
}
if (length <= 1)
{
return;
}
if (comparer == null)
{
Array.Swapper swapper;
if (items == null)
{
swapper = null;
}
else
{
swapper = Array.get_swapper(items);
}
if (keys is double[])
{
Array.combsort(keys as double[], index, length, swapper);
return;
}
if (!(keys is uint[]) && keys is int[])
{
Array.combsort(keys as int[], index, length, swapper);
return;
}
if (keys is char[])
{
Array.combsort(keys as char[], index, length, swapper);
return;
}
}
try
{
int num = index + length - 1;
Array.qsort(keys, items, index, num, comparer);
}
catch (Exception ex)
{
throw new InvalidOperationException(Locale.GetText("The comparer threw an exception."), ex);
}
}
/// Sorts the elements in an using the specified .
/// The one-dimensional, zero-based to sort
/// The to use when comparing elements.
/// The type of the elements of the array.
///
/// is null.-or- is null.
/// The implementation of caused an error during the sort. For example, might not return 0 when comparing an item with itself.
// Token: 0x0600045F RID: 1119 RVA: 0x00011ABC File Offset: 0x0000FCBC
public static void Sort(T[] array, Comparison comparison)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
Array.Sort(array, array.Length, comparison);
}
// Token: 0x06000460 RID: 1120 RVA: 0x00011ADC File Offset: 0x0000FCDC
internal static void Sort(T[] array, int length, Comparison comparison)
{
if (comparison == null)
{
throw new ArgumentNullException("comparison");
}
if (length <= 1 || array.Length <= 1)
{
return;
}
try
{
int num = 0;
int num2 = length - 1;
Array.qsort(array, num, num2, comparison);
}
catch (Exception ex)
{
throw new InvalidOperationException(Locale.GetText("Comparison threw an exception."), ex);
}
}
// Token: 0x06000461 RID: 1121 RVA: 0x00011B54 File Offset: 0x0000FD54
private static void qsort(K[] keys, V[] items, int low0, int high0, IComparer comparer)
{
if (low0 >= high0)
{
return;
}
int num = low0;
int num2 = high0;
int num3 = num + (num2 - num) / 2;
K k = keys[num3];
for (;;)
{
while (num < high0 && Array.compare(keys[num], k, comparer) < 0)
{
num++;
}
while (num2 > low0 && Array.compare(k, keys[num2], comparer) < 0)
{
num2--;
}
if (num > num2)
{
break;
}
Array.swap(keys, items, num, num2);
num++;
num2--;
}
if (low0 < num2)
{
Array.qsort(keys, items, low0, num2, comparer);
}
if (num < high0)
{
Array.qsort(keys, items, num, high0, comparer);
}
}
// Token: 0x06000462 RID: 1122 RVA: 0x00011C14 File Offset: 0x0000FE14
private static int compare(T value1, T value2, IComparer comparer)
{
if (comparer != null)
{
return comparer.Compare(value1, value2);
}
if (value1 == null)
{
return (value2 != null) ? (-1) : 0;
}
if (value2 == null)
{
return 1;
}
if (value1 is IComparable)
{
return ((IComparable)((object)value1)).CompareTo(value2);
}
if (value1 is IComparable)
{
return ((IComparable)((object)value1)).CompareTo(value2);
}
string text = Locale.GetText("No IComparable or IComparable<{0}> interface found.");
throw new InvalidOperationException(string.Format(text, typeof(T)));
}
// Token: 0x06000463 RID: 1123 RVA: 0x00011CC4 File Offset: 0x0000FEC4
private static void qsort(T[] array, int low0, int high0, Comparison comparison)
{
if (low0 >= high0)
{
return;
}
int num = low0;
int num2 = high0;
int num3 = num + (num2 - num) / 2;
T t = array[num3];
for (;;)
{
while (num < high0 && comparison(array[num], t) < 0)
{
num++;
}
while (num2 > low0 && comparison(t, array[num2]) < 0)
{
num2--;
}
if (num > num2)
{
break;
}
Array.swap(array, num, num2);
num++;
num2--;
}
if (low0 < num2)
{
Array.qsort(array, low0, num2, comparison);
}
if (num < high0)
{
Array.qsort(array, num, high0, comparison);
}
}
// Token: 0x06000464 RID: 1124 RVA: 0x00011D7C File Offset: 0x0000FF7C
private static void swap(K[] keys, V[] items, int i, int j)
{
K k = keys[i];
keys[i] = keys[j];
keys[j] = k;
if (items != null)
{
V v = items[i];
items[i] = items[j];
items[j] = v;
}
}
// Token: 0x06000465 RID: 1125 RVA: 0x00011DCC File Offset: 0x0000FFCC
private static void swap(T[] array, int i, int j)
{
T t = array[i];
array[i] = array[j];
array[j] = t;
}
/// Copies all the elements of the current one-dimensional to the specified one-dimensional starting at the specified destination index. The index is specified as a 32-bit integer.
/// The one-dimensional that is the destination of the elements copied from the current .
/// A 32-bit integer that represents the index in at which copying begins.
///
/// is null.
///
/// is less than the lower bound of .
///
/// is multidimensional.-or-The number of elements in the source is greater than the available space from to the end of the destination .
/// The type of the source cannot be cast automatically to the type of the destination .
/// The source is multidimensional.
/// At least one element in the source cannot be cast to the type of destination .
/// 2
// Token: 0x06000466 RID: 1126 RVA: 0x00011DF8 File Offset: 0x0000FFF8
public void CopyTo(Array array, int index)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (this.Rank > 1)
{
throw new RankException(Locale.GetText("Only single dimension arrays are supported."));
}
if (index + this.GetLength(0) > array.GetLowerBound(0) + array.GetLength(0))
{
throw new ArgumentException("Destination array was not long enough. Check destIndex and length, and the array's lower bounds.");
}
if (array.Rank > 1)
{
throw new RankException(Locale.GetText("Only single dimension arrays are supported."));
}
if (index < 0)
{
throw new ArgumentOutOfRangeException("index", Locale.GetText("Value has to be >= 0."));
}
Array.Copy(this, this.GetLowerBound(0), array, index, this.GetLength(0));
}
/// Copies all the elements of the current one-dimensional to the specified one-dimensional starting at the specified destination index. The index is specified as a 64-bit integer.
/// The one-dimensional that is the destination of the elements copied from the current .
/// A 64-bit integer that represents the index in at which copying begins.
///
/// is null.
///
/// is outside the range of valid indexes for .
///
/// is multidimensional.-or-The number of elements in the source is greater than the available space from to the end of the destination .
/// The type of the source cannot be cast automatically to the type of the destination .
/// The source is multidimensional.
/// At least one element in the source cannot be cast to the type of destination .
/// 2
// Token: 0x06000467 RID: 1127 RVA: 0x00011EA8 File Offset: 0x000100A8
[ComVisible(false)]
public void CopyTo(Array array, long index)
{
if (index < 0L || index > 2147483647L)
{
throw new ArgumentOutOfRangeException("index", Locale.GetText("Value must be >= 0 and <= Int32.MaxValue."));
}
this.CopyTo(array, (int)index);
}
/// Changes the number of elements of an array to the specified new size.
/// The one-dimensional, zero-based array to resize, or null to create a new array with the specified size.
/// The size of the new array.
/// The type of the elements of the array.
///
/// is less than zero.
// Token: 0x06000468 RID: 1128 RVA: 0x00011EE8 File Offset: 0x000100E8
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static void Resize(ref T[] array, int newSize)
{
Array.Resize(ref array, (array != null) ? array.Length : 0, newSize);
}
// Token: 0x06000469 RID: 1129 RVA: 0x00011F04 File Offset: 0x00010104
internal static void Resize(ref T[] array, int length, int newSize)
{
if (newSize < 0)
{
throw new ArgumentOutOfRangeException();
}
if (array == null)
{
array = new T[newSize];
return;
}
if (array.Length == newSize)
{
return;
}
T[] array2 = new T[newSize];
Array.Copy(array, array2, Math.Min(newSize, length));
array = array2;
}
/// Determines whether every element in the array matches the conditions defined by the specified predicate.
/// true if every element in matches the conditions defined by the specified predicate; otherwise, false. If there are no elements in the array, the return value is true.
/// The one-dimensional, zero-based to check against the conditions
/// The that defines the conditions to check against the elements.
/// The type of the elements of the array.
///
/// is null.-or- is null.
// Token: 0x0600046A RID: 1130 RVA: 0x00011F54 File Offset: 0x00010154
public static bool TrueForAll(T[] array, Predicate match)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (match == null)
{
throw new ArgumentNullException("match");
}
foreach (T t in array)
{
if (!match(t))
{
return false;
}
}
return true;
}
/// Performs the specified action on each element of the specified array.
/// The one-dimensional, zero-based on whose elements the action is to be performed.
/// The to perform on each element of .
/// The type of the elements of the array.
///
/// is null.-or- is null.
// Token: 0x0600046B RID: 1131 RVA: 0x00011FB0 File Offset: 0x000101B0
public static void ForEach(T[] array, Action action)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (action == null)
{
throw new ArgumentNullException("action");
}
foreach (T t in array)
{
action(t);
}
}
/// Converts an array of one type to an array of another type.
/// An array of the target type containing the converted elements from the source array.
/// The one-dimensional, zero-based to convert to a target type.
/// A that converts each element from one type to another type.
/// The type of the elements of the source array.
/// The type of the elements of the target array.
///
/// is null.-or- is null.
// Token: 0x0600046C RID: 1132 RVA: 0x00012004 File Offset: 0x00010204
public static TOutput[] ConvertAll(TInput[] array, Converter converter)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (converter == null)
{
throw new ArgumentNullException("converter");
}
TOutput[] array2 = new TOutput[array.Length];
for (int i = 0; i < array.Length; i++)
{
array2[i] = converter(array[i]);
}
return array2;
}
/// 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 .
/// The zero-based index of the last occurrence of an element that matches the conditions defined by , if found; otherwise, –1.
/// The one-dimensional, zero-based to search.
/// The that defines the conditions of the element to search for.
/// The type of the elements of the array.
///
/// is null.-or- is null.
// Token: 0x0600046D RID: 1133 RVA: 0x00012068 File Offset: 0x00010268
public static int FindLastIndex(T[] array, Predicate match)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
return Array.FindLastIndex(array, 0, array.Length, match);
}
/// 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 that extends from the first element to the specified index.
/// The zero-based index of the last occurrence of an element that matches the conditions defined by , if found; otherwise, –1.
/// The one-dimensional, zero-based to search.
/// The zero-based starting index of the backward search.
/// The that defines the conditions of the element to search for.
/// The type of the elements of the array.
///
/// is null.-or- is null.
///
/// is outside the range of valid indexes for .
// Token: 0x0600046E RID: 1134 RVA: 0x00012088 File Offset: 0x00010288
public static int FindLastIndex(T[] array, int startIndex, Predicate match)
{
if (array == null)
{
throw new ArgumentNullException();
}
return Array.FindLastIndex(array, startIndex, array.Length - startIndex, match);
}
/// 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 that contains the specified number of elements and ends at the specified index.
/// The zero-based index of the last occurrence of an element that matches the conditions defined by , if found; otherwise, –1.
/// The one-dimensional, zero-based to search.
/// The zero-based starting index of the backward search.
/// The number of elements in the section to search.
/// The that defines the conditions of the element to search for.
/// The type of the elements of the array.
///
/// is null.-or- is null.
///
/// is outside the range of valid indexes for .-or- is less than zero.-or- and do not specify a valid section in .
// Token: 0x0600046F RID: 1135 RVA: 0x000120A4 File Offset: 0x000102A4
public static int FindLastIndex(T[] array, int startIndex, int count, Predicate match)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (match == null)
{
throw new ArgumentNullException("match");
}
if (startIndex > array.Length || startIndex + count > array.Length)
{
throw new ArgumentOutOfRangeException();
}
for (int i = startIndex + count - 1; i >= startIndex; i--)
{
if (match(array[i]))
{
return i;
}
}
return -1;
}
/// 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 .
/// The zero-based index of the first occurrence of an element that matches the conditions defined by , if found; otherwise, –1.
/// The one-dimensional, zero-based to search.
/// The that defines the conditions of the element to search for.
/// The type of the elements of the array.
///
/// is null.-or- is null.
// Token: 0x06000470 RID: 1136 RVA: 0x00012118 File Offset: 0x00010318
public static int FindIndex(T[] array, Predicate match)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
return Array.FindIndex(array, 0, array.Length, match);
}
/// 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 that extends from the specified index to the last element.
/// The zero-based index of the first occurrence of an element that matches the conditions defined by , if found; otherwise, –1.
/// The one-dimensional, zero-based to search.
/// The zero-based starting index of the search.
/// The that defines the conditions of the element to search for.
/// The type of the elements of the array.
///
/// is null.-or- is null.
///
/// is outside the range of valid indexes for .
// Token: 0x06000471 RID: 1137 RVA: 0x00012138 File Offset: 0x00010338
public static int FindIndex(T[] array, int startIndex, Predicate match)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
return Array.FindIndex(array, startIndex, array.Length - startIndex, match);
}
/// 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 that starts at the specified index and contains the specified number of elements.
/// The zero-based index of the first occurrence of an element that matches the conditions defined by , if found; otherwise, –1.
/// The one-dimensional, zero-based to search.
/// The zero-based starting index of the search.
/// The number of elements in the section to search.
/// The that defines the conditions of the element to search for.
/// The type of the elements of the array.
///
/// is null.-or- is null.
///
/// is outside the range of valid indexes for .-or- is less than zero.-or- and do not specify a valid section in .
// Token: 0x06000472 RID: 1138 RVA: 0x00012158 File Offset: 0x00010358
public static int FindIndex(T[] array, int startIndex, int count, Predicate match)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (match == null)
{
throw new ArgumentNullException("match");
}
if (startIndex > array.Length || startIndex + count > array.Length)
{
throw new ArgumentOutOfRangeException();
}
for (int i = startIndex; i < startIndex + count; i++)
{
if (match(array[i]))
{
return i;
}
}
return -1;
}
/// Searches an entire one-dimensional sorted for a specific element, using the generic interface implemented by each element of the and by the specified object.
/// The index of the specified in the specified , if is found. If is not found and is less than one or more elements in , a negative number which is the bitwise complement of the index of the first element that is larger than . If is not found and is greater than any of the elements in , a negative number which is the bitwise complement of (the index of the last element plus 1).
/// The sorted one-dimensional, zero-based to search.
/// The object to search for.
/// The type of the elements of the array.
///
/// is null.
///
/// does not implement the generic interface, and the search encounters an element that does not implement the generic interface.
// Token: 0x06000473 RID: 1139 RVA: 0x000121CC File Offset: 0x000103CC
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int BinarySearch(T[] array, T value)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
return Array.BinarySearch(array, 0, array.Length, value, null);
}
/// Searches an entire one-dimensional sorted for a value using the specified generic interface.
/// The index of the specified in the specified , if is found. If is not found and is less than one or more elements in , a negative number which is the bitwise complement of the index of the first element that is larger than . If is not found and is greater than any of the elements in , a negative number which is the bitwise complement of (the index of the last element plus 1).
/// The sorted one-dimensional, zero-based to search.
/// The object to search for.
/// The implementation to use when comparing elements.-or- null to use the implementation of each element.
/// The type of the elements of the array.
///
/// is null.
///
/// is null, and is of a type that is not compatible with the elements of .
///
/// is null, does not implement the generic interface, and the search encounters an element that does not implement the generic interface.
// Token: 0x06000474 RID: 1140 RVA: 0x000121EC File Offset: 0x000103EC
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int BinarySearch(T[] array, T value, IComparer comparer)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
return Array.BinarySearch(array, 0, array.Length, value, comparer);
}
/// Searches a range of elements in a one-dimensional sorted for a value, using the generic interface implemented by each element of the and by the specified value.
/// The index of the specified in the specified , if is found. If is not found and is less than one or more elements in , a negative number which is the bitwise complement of the index of the first element that is larger than . If is not found and is greater than any of the elements in , a negative number which is the bitwise complement of (the index of the last element plus 1).
/// The sorted one-dimensional, zero-based to search.
/// The starting index of the range to search.
/// The length of the range to search.
/// The object to search for.
/// The type of the elements of the array.
///
/// is null.
///
/// is less than the lower bound of .-or- is less than zero.
///
/// and do not specify a valid range in .-or- is of a type that is not compatible with the elements of .
///
/// does not implement the generic interface, and the search encounters an element that does not implement the generic interface.
// Token: 0x06000475 RID: 1141 RVA: 0x0001220C File Offset: 0x0001040C
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int BinarySearch(T[] array, int index, int length, T value)
{
return Array.BinarySearch(array, index, length, value, null);
}
/// Searches a range of elements in a one-dimensional sorted for a value, using the specified generic interface.
/// The index of the specified in the specified , if is found. If is not found and is less than one or more elements in , a negative number which is the bitwise complement of the index of the first element that is larger than . If is not found and is greater than any of the elements in , a negative number which is the bitwise complement of (the index of the last element plus 1).
/// The sorted one-dimensional, zero-based to search.
/// The starting index of the range to search.
/// The length of the range to search.
/// The object to search for.
/// The implementation to use when comparing elements.-or- null to use the implementation of each element.
/// The type of the elements of the array.
///
/// is null.
///
/// is less than the lower bound of .-or- is less than zero.
///
/// and do not specify a valid range in .-or- is null, and is of a type that is not compatible with the elements of .
///
/// is null, does not implement the generic interface, and the search encounters an element that does not implement the generic interface.
// Token: 0x06000476 RID: 1142 RVA: 0x00012218 File Offset: 0x00010418
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int BinarySearch(T[] array, int index, int length, T value, IComparer comparer)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (index < 0)
{
throw new ArgumentOutOfRangeException("index", Locale.GetText("index is less than the lower bound of array."));
}
if (length < 0)
{
throw new ArgumentOutOfRangeException("length", Locale.GetText("Value has to be >= 0."));
}
if (index > array.Length - length)
{
throw new ArgumentException(Locale.GetText("index and length do not specify a valid range in array."));
}
if (comparer == null)
{
comparer = Comparer.Default;
}
int i = index;
int num = index + length - 1;
try
{
while (i <= num)
{
int num2 = i + (num - i) / 2;
int num3 = comparer.Compare(value, array[num2]);
if (num3 == 0)
{
return num2;
}
if (num3 < 0)
{
num = num2 - 1;
}
else
{
i = num2 + 1;
}
}
}
catch (Exception ex)
{
throw new InvalidOperationException(Locale.GetText("Comparer threw an exception."), ex);
}
return ~i;
}
/// Searches for the specified object and returns the index of the first occurrence within the entire .
/// The zero-based index of the first occurrence of within the entire , if found; otherwise, –1.
/// The one-dimensional, zero-based to search.
/// The object to locate in .
/// The type of the elements of the array.
///
/// is null.
// Token: 0x06000477 RID: 1143 RVA: 0x00012328 File Offset: 0x00010528
public static int IndexOf(T[] array, T value)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
return Array.IndexOf(array, value, 0, array.Length);
}
/// Searches for the specified object and returns the index of the first occurrence within the range of elements in the that extends from the specified index to the last element.
/// The zero-based index of the first occurrence of within the range of elements in that extends from to the last element, if found; otherwise, –1.
/// The one-dimensional, zero-based to search.
/// The object to locate in .
/// The zero-based starting index of the search. 0 (zero) is valid in an empty array.
/// The type of the elements of the array.
///
/// is null.
///
/// is outside the range of valid indexes for .
// Token: 0x06000478 RID: 1144 RVA: 0x00012348 File Offset: 0x00010548
public static int IndexOf(T[] array, T value, int startIndex)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
return Array.IndexOf(array, value, startIndex, array.Length - startIndex);
}
/// Searches for the specified object and returns the index of the first occurrence within the range of elements in the that starts at the specified index and contains the specified number of elements.
/// The zero-based index of the first occurrence of within the range of elements in that starts at and contains the number of elements specified in , if found; otherwise, –1.
/// The one-dimensional, zero-based to search.
/// The object to locate in .
/// The zero-based starting index of the search. 0 (zero) is valid in an empty array.
/// The number of elements in the section to search.
/// The type of the elements of the array.
///
/// is null.
///
/// is outside the range of valid indexes for .-or- is less than zero.-or- and do not specify a valid section in .
// Token: 0x06000479 RID: 1145 RVA: 0x00012368 File Offset: 0x00010568
public static int IndexOf(T[] array, T value, int startIndex, int count)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (count < 0 || startIndex < array.GetLowerBound(0) || startIndex - 1 > array.GetUpperBound(0) - count)
{
throw new ArgumentOutOfRangeException();
}
int num = startIndex + count;
EqualityComparer @default = EqualityComparer.Default;
for (int i = startIndex; i < num; i++)
{
if (@default.Equals(array[i], value))
{
return i;
}
}
return -1;
}
/// Searches for the specified object and returns the index of the last occurrence within the entire .
/// The zero-based index of the last occurrence of within the entire , if found; otherwise, –1.
/// The one-dimensional, zero-based to search.
/// The object to locate in .
/// The type of the elements of the array.
///
/// is null.
// Token: 0x0600047A RID: 1146 RVA: 0x000123E4 File Offset: 0x000105E4
public static int LastIndexOf(T[] array, T value)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (array.Length == 0)
{
return -1;
}
return Array.LastIndexOf(array, value, array.Length - 1);
}
/// Searches for the specified object and returns the index of the last occurrence within the range of elements in the that extends from the first element to the specified index.
/// The zero-based index of the last occurrence of within the range of elements in that extends from the first element to , if found; otherwise, –1.
/// The one-dimensional, zero-based to search.
/// The object to locate in .
/// The zero-based starting index of the backward search.
/// The type of the elements of the array.
///
/// is null.
///
/// is outside the range of valid indexes for .
// Token: 0x0600047B RID: 1147 RVA: 0x00012410 File Offset: 0x00010610
public static int LastIndexOf(T[] array, T value, int startIndex)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
return Array.LastIndexOf(array, value, startIndex, startIndex + 1);
}
/// Searches for the specified object and returns the index of the last occurrence within the range of elements in the that contains the specified number of elements and ends at the specified index.
/// The zero-based index of the last occurrence of within the range of elements in that contains the number of elements specified in and ends at , if found; otherwise, –1.
/// The one-dimensional, zero-based to search.
/// The object to locate in .
/// The zero-based starting index of the backward search.
/// The number of elements in the section to search.
/// The type of the elements of the array.
///
/// is null.
///
/// is outside the range of valid indexes for .-or- is less than zero.-or- and do not specify a valid section in .
// Token: 0x0600047C RID: 1148 RVA: 0x00012430 File Offset: 0x00010630
public static int LastIndexOf(T[] array, T value, int startIndex, int count)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (count < 0 || startIndex < array.GetLowerBound(0) || startIndex > array.GetUpperBound(0) || startIndex - count + 1 < array.GetLowerBound(0))
{
throw new ArgumentOutOfRangeException();
}
EqualityComparer @default = EqualityComparer.Default;
for (int i = startIndex; i >= startIndex - count + 1; i--)
{
if (@default.Equals(array[i], value))
{
return i;
}
}
return -1;
}
/// Retrieves all the elements that match the conditions defined by the specified predicate.
/// An containing all the elements that match the conditions defined by the specified predicate, if found; otherwise, an empty .
/// The one-dimensional, zero-based to search.
/// The that defines the conditions of the elements to search for.
/// The type of the elements of the array.
///
/// is null.-or- is null.
// Token: 0x0600047D RID: 1149 RVA: 0x000124B8 File Offset: 0x000106B8
public static T[] FindAll(T[] array, Predicate match)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (match == null)
{
throw new ArgumentNullException("match");
}
int num = 0;
T[] array2 = new T[array.Length];
foreach (T t in array)
{
if (match(t))
{
array2[num++] = t;
}
}
Array.Resize(ref array2, num);
return array2;
}
/// Determines whether the specified array contains elements that match the conditions defined by the specified predicate.
/// true if contains one or more elements that match the conditions defined by the specified predicate; otherwise, false.
/// The one-dimensional, zero-based to search.
/// The that defines the conditions of the elements to search for.
/// The type of the elements of the array.
///
/// is null.-or- is null.
// Token: 0x0600047E RID: 1150 RVA: 0x00012538 File Offset: 0x00010738
public static bool Exists(T[] array, Predicate match)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (match == null)
{
throw new ArgumentNullException("match");
}
foreach (T t in array)
{
if (match(t))
{
return true;
}
}
return false;
}
/// Returns a read-only wrapper for the specified array.
/// A read-only wrapper for the specified array.
/// The one-dimensional, zero-based array to wrap in a read-only wrapper.
/// The type of the elements of the array.
///
/// is null.
// Token: 0x0600047F RID: 1151 RVA: 0x00012594 File Offset: 0x00010794
public static ReadOnlyCollection AsReadOnly(T[] array)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
return new ReadOnlyCollection(new Array.ArrayReadOnlyList(array));
}
/// Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire .
/// The first element that matches the conditions defined by the specified predicate, if found; otherwise, the default value for type .
/// The one-dimensional, zero-based to search.
/// The that defines the conditions of the element to search for.
/// The type of the elements of the array.
///
/// is null.-or- is null.
// Token: 0x06000480 RID: 1152 RVA: 0x000125B4 File Offset: 0x000107B4
public static T Find(T[] array, Predicate match)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (match == null)
{
throw new ArgumentNullException("match");
}
foreach (T t in array)
{
if (match(t))
{
return t;
}
}
return default(T);
}
/// Searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire .
/// The last element that matches the conditions defined by the specified predicate, if found; otherwise, the default value for type .
/// The one-dimensional, zero-based to search.
/// The that defines the conditions of the element to search for.
/// The type of the elements of the array.
///
/// is null.-or- is null.
// Token: 0x06000481 RID: 1153 RVA: 0x00012618 File Offset: 0x00010818
public static T FindLast(T[] array, Predicate match)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (match == null)
{
throw new ArgumentNullException("match");
}
for (int i = array.Length - 1; i >= 0; i--)
{
if (match(array[i]))
{
return array[i];
}
}
return default(T);
}
/// Copies a range of elements from an starting at the specified source index and pastes them to another starting at the specified destination index. Guarantees that all changes are undone if the copy does not succeed completely.
/// The that contains the data to copy.
/// A 32-bit integer that represents the index in the at which copying begins.
/// The that receives the data.
/// A 32-bit integer that represents the index in the at which storing begins.
/// A 32-bit integer that represents the number of elements to copy.
///
/// is null.-or- is null.
///
/// and have different ranks.
/// The type is neither the same as nor derived from the type.
/// At least one element in cannot be cast to the type of .
///
/// is less than the lower bound of the first dimension of .-or- is less than the lower bound of the first dimension of .-or- is less than zero.
///
/// is greater than the number of elements from to the end of .-or- is greater than the number of elements from to the end of .
// Token: 0x06000482 RID: 1154 RVA: 0x00012680 File Offset: 0x00010880
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public static void ConstrainedCopy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length)
{
Array.Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length);
}
// Token: 0x0200002A RID: 42
internal struct InternalEnumerator : IEnumerator, IDisposable, IEnumerator
{
// Token: 0x06000483 RID: 1155 RVA: 0x00012690 File Offset: 0x00010890
internal InternalEnumerator(Array array)
{
this.array = array;
this.idx = -2;
}
// Token: 0x06000484 RID: 1156 RVA: 0x000126A4 File Offset: 0x000108A4
void IEnumerator.Reset()
{
this.idx = -2;
}
// Token: 0x17000019 RID: 25
// (get) Token: 0x06000485 RID: 1157 RVA: 0x000126B0 File Offset: 0x000108B0
object IEnumerator.Current
{
get
{
return this.Current;
}
}
// Token: 0x06000486 RID: 1158 RVA: 0x000126C0 File Offset: 0x000108C0
public void Dispose()
{
this.idx = -2;
}
// Token: 0x06000487 RID: 1159 RVA: 0x000126CC File Offset: 0x000108CC
public bool MoveNext()
{
if (this.idx == -2)
{
this.idx = this.array.Length;
}
return this.idx != -1 && --this.idx != -1;
}
// Token: 0x1700001A RID: 26
// (get) Token: 0x06000488 RID: 1160 RVA: 0x00012720 File Offset: 0x00010920
public T Current
{
get
{
if (this.idx == -2)
{
throw new InvalidOperationException("Enumeration has not started. Call MoveNext");
}
if (this.idx == -1)
{
throw new InvalidOperationException("Enumeration already finished");
}
return this.array.InternalArray__get_Item(this.array.Length - 1 - this.idx);
}
}
// Token: 0x04000066 RID: 102
private const int NOT_STARTED = -2;
// Token: 0x04000067 RID: 103
private const int FINISHED = -1;
// Token: 0x04000068 RID: 104
private Array array;
// Token: 0x04000069 RID: 105
private int idx;
}
// Token: 0x0200002B RID: 43
internal class SimpleEnumerator : IEnumerator, ICloneable
{
// Token: 0x06000489 RID: 1161 RVA: 0x0001277C File Offset: 0x0001097C
public SimpleEnumerator(Array arrayToEnumerate)
{
this.enumeratee = arrayToEnumerate;
this.currentpos = -1;
this.length = arrayToEnumerate.Length;
}
// Token: 0x1700001B RID: 27
// (get) Token: 0x0600048A RID: 1162 RVA: 0x000127AC File Offset: 0x000109AC
public object Current
{
get
{
if (this.currentpos < 0)
{
throw new InvalidOperationException(Locale.GetText("Enumeration has not started."));
}
if (this.currentpos >= this.length)
{
throw new InvalidOperationException(Locale.GetText("Enumeration has already ended"));
}
return this.enumeratee.GetValueImpl(this.currentpos);
}
}
// Token: 0x0600048B RID: 1163 RVA: 0x00012808 File Offset: 0x00010A08
public bool MoveNext()
{
if (this.currentpos < this.length)
{
this.currentpos++;
}
return this.currentpos < this.length;
}
// Token: 0x0600048C RID: 1164 RVA: 0x00012840 File Offset: 0x00010A40
public void Reset()
{
this.currentpos = -1;
}
// Token: 0x0600048D RID: 1165 RVA: 0x0001284C File Offset: 0x00010A4C
public object Clone()
{
return base.MemberwiseClone();
}
// Token: 0x0400006A RID: 106
private Array enumeratee;
// Token: 0x0400006B RID: 107
private int currentpos;
// Token: 0x0400006C RID: 108
private int length;
}
// Token: 0x0200002C RID: 44
private class ArrayReadOnlyList : IEnumerable, IList, ICollection, IEnumerable
{
// Token: 0x0600048E RID: 1166 RVA: 0x00012854 File Offset: 0x00010A54
public ArrayReadOnlyList(T[] array)
{
this.array = array;
}
// Token: 0x0600048F RID: 1167 RVA: 0x00012864 File Offset: 0x00010A64
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
// Token: 0x1700001C RID: 28
public T this[int index]
{
get
{
if (index >= this.array.Length)
{
throw new ArgumentOutOfRangeException("index");
}
return this.array[index];
}
set
{
throw Array.ArrayReadOnlyList.ReadOnlyError();
}
}
// Token: 0x1700001D RID: 29
// (get) Token: 0x06000492 RID: 1170 RVA: 0x0001289C File Offset: 0x00010A9C
public int Count
{
get
{
return this.array.Length;
}
}
// Token: 0x1700001E RID: 30
// (get) Token: 0x06000493 RID: 1171 RVA: 0x000128A8 File Offset: 0x00010AA8
public bool IsReadOnly
{
get
{
return true;
}
}
// Token: 0x06000494 RID: 1172 RVA: 0x000128AC File Offset: 0x00010AAC
public void Add(T item)
{
throw Array.ArrayReadOnlyList.ReadOnlyError();
}
// Token: 0x06000495 RID: 1173 RVA: 0x000128B4 File Offset: 0x00010AB4
public void Clear()
{
throw Array.ArrayReadOnlyList.ReadOnlyError();
}
// Token: 0x06000496 RID: 1174 RVA: 0x000128BC File Offset: 0x00010ABC
public bool Contains(T item)
{
return Array.IndexOf(this.array, item) >= 0;
}
// Token: 0x06000497 RID: 1175 RVA: 0x000128D0 File Offset: 0x00010AD0
public void CopyTo(T[] array, int index)
{
this.array.CopyTo(array, index);
}
// Token: 0x06000498 RID: 1176 RVA: 0x000128E0 File Offset: 0x00010AE0
public IEnumerator GetEnumerator()
{
for (int i = 0; i < this.array.Length; i++)
{
yield return this.array[i];
}
yield break;
}
// Token: 0x06000499 RID: 1177 RVA: 0x000128FC File Offset: 0x00010AFC
public int IndexOf(T item)
{
return Array.IndexOf(this.array, item);
}
// Token: 0x0600049A RID: 1178 RVA: 0x0001290C File Offset: 0x00010B0C
public void Insert(int index, T item)
{
throw Array.ArrayReadOnlyList.ReadOnlyError();
}
// Token: 0x0600049B RID: 1179 RVA: 0x00012914 File Offset: 0x00010B14
public bool Remove(T item)
{
throw Array.ArrayReadOnlyList.ReadOnlyError();
}
// Token: 0x0600049C RID: 1180 RVA: 0x0001291C File Offset: 0x00010B1C
public void RemoveAt(int index)
{
throw Array.ArrayReadOnlyList.ReadOnlyError();
}
// Token: 0x0600049D RID: 1181 RVA: 0x00012924 File Offset: 0x00010B24
private static Exception ReadOnlyError()
{
return new NotSupportedException("This collection is read-only.");
}
// Token: 0x0400006D RID: 109
private T[] array;
}
// Token: 0x02000031 RID: 49
// (Invoke) Token: 0x060004BA RID: 1210
private delegate void Swapper(int i, int j);
}
}