11 [DebuggerTypeProxy(typeof(ArrayListDebugView))]
12 [DebuggerDisplay(
"Count = {Count}")]
24 private int _remaining;
26 private int _initialStartIndex;
28 private int _initialCount;
30 private bool _firstCall;
48 private IListWrapperEnumWrapper()
52 internal IListWrapperEnumWrapper(IListWrapper listWrapper,
int startIndex,
int count)
54 _en = listWrapper.GetEnumerator();
55 _initialStartIndex = startIndex;
56 _initialCount = count;
57 while (startIndex-- > 0 && _en.MoveNext())
66 IListWrapperEnumWrapper listWrapperEnumWrapper =
new IListWrapperEnumWrapper();
68 listWrapperEnumWrapper._initialStartIndex = _initialStartIndex;
69 listWrapperEnumWrapper._initialCount = _initialCount;
70 listWrapperEnumWrapper._remaining = _remaining;
71 listWrapperEnumWrapper._firstCall = _firstCall;
72 return listWrapperEnumWrapper;
75 public bool MoveNext()
82 return _en.MoveNext();
92 return _remaining-- > 0;
100 int num = _initialStartIndex;
101 while (num-- > 0 && _en.MoveNext())
104 _remaining = _initialCount;
134 public override object this[
int index]
142 _list[index] = value;
149 internal IListWrapper(
IList list)
155 public override int Add(
object obj)
157 int result = _list.
Add(obj);
169 if (index < 0 || count < 0)
173 if (
Count - index < count)
177 if (comparer ==
null)
182 int num2 = index + count - 1;
185 int num3 = (num + num2) / 2;
186 int num4 = comparer.
Compare(value, _list[num3]);
203 public override void Clear()
213 public override object Clone()
215 return new IListWrapper(_list);
218 public override bool Contains(
object obj)
223 public override void CopyTo(
Array array,
int index)
225 _list.
CopyTo(array, index);
228 public override void CopyTo(
int index,
Array array,
int arrayIndex,
int count)
234 if (index < 0 || arrayIndex < 0)
242 if (array.Length - arrayIndex < count)
250 if (_list.
Count - index < count)
254 for (
int i = index; i < index + count; i++)
256 array.SetValue(_list[i], arrayIndex++);
267 if (index < 0 || count < 0)
271 if (_list.
Count - index < count)
275 return new IListWrapperEnumWrapper(
this, index, count);
278 public override int IndexOf(
object value)
283 public override int IndexOf(
object value,
int startIndex)
285 return IndexOf(value, startIndex, _list.
Count - startIndex);
288 public override int IndexOf(
object value,
int startIndex,
int count)
290 if (startIndex < 0 || startIndex >
Count)
294 if (count < 0 || startIndex >
Count - count)
298 int num = startIndex + count;
301 for (
int i = startIndex; i < num; i++)
303 if (_list[i] ==
null)
310 for (
int j = startIndex; j < num; j++)
312 if (_list[j] !=
null && _list[j].Equals(value))
320 public override void Insert(
int index,
object obj)
332 if (index < 0 || index >
Count)
341 if (arrayList !=
null)
361 public override int LastIndexOf(
object value,
int startIndex)
363 return LastIndexOf(value, startIndex, startIndex + 1);
366 public override int LastIndexOf(
object value,
int startIndex,
int count)
368 if (_list.
Count == 0)
372 if (startIndex < 0 || startIndex >= _list.
Count)
376 if (count < 0 || count > startIndex + 1)
380 int num = startIndex - count + 1;
383 for (
int num2 = startIndex; num2 >= num; num2--)
385 if (_list[num2] ==
null)
392 for (
int num3 = startIndex; num3 >= num; num3--)
394 if (_list[num3] !=
null && _list[num3].Equals(value))
402 public override void Remove(
object value)
411 public override void RemoveAt(
int index)
417 public override void RemoveRange(
int index,
int count)
419 if (index < 0 || count < 0)
423 if (_list.
Count - index < count)
438 public override void Reverse(
int index,
int count)
440 if (index < 0 || count < 0)
444 if (_list.
Count - index < count)
449 int num2 = index + count - 1;
452 object value = _list[num];
453 _list[num++] = _list[num2];
454 _list[num2--] = value;
465 if (index < 0 || index > _list.
Count - c.
Count)
474 _list[index++] = enumerator.
Current;
482 if (index < 0 || count < 0)
486 if (_list.
Count - index < count)
490 return new Range(
this, index, count);
493 public override void Sort(
int index,
int count,
IComparer comparer)
495 if (index < 0 || count < 0)
499 if (_list.
Count - index < count)
503 object[] array =
new object[count];
504 CopyTo(index, array, 0, count);
506 for (
int i = 0; i < count; i++)
508 _list[i + index] = array[i];
513 public override object[]
ToArray()
515 object[] array =
new object[
Count];
520 [SecuritySafeCritical]
542 private object _root;
562 public override int Count 579 public override object this[
int index]
592 _list[index] = value;
597 public override object SyncRoot => _root;
603 _root = list.SyncRoot;
606 public override int Add(
object value)
610 return _list.
Add(value);
642 return _list.
BinarySearch(index, count, value, comparer);
646 public override void Clear()
654 public override object Clone()
662 public override bool Contains(
object item)
678 public override void CopyTo(
Array array,
int index)
682 _list.
CopyTo(array, index);
686 public override void CopyTo(
int index,
Array array,
int arrayIndex,
int count)
690 _list.
CopyTo(index, array, arrayIndex, count);
710 public override int IndexOf(
object value)
718 public override int IndexOf(
object value,
int startIndex)
722 return _list.
IndexOf(value, startIndex);
726 public override int IndexOf(
object value,
int startIndex,
int count)
730 return _list.
IndexOf(value, startIndex, count);
734 public override void Insert(
int index,
object value)
738 _list.
Insert(index, value);
758 public override int LastIndexOf(
object value,
int startIndex)
766 public override int LastIndexOf(
object value,
int startIndex,
int count)
770 return _list.
LastIndexOf(value, startIndex, count);
774 public override void Remove(
object value)
782 public override void RemoveAt(
int index)
790 public override void RemoveRange(
int index,
int count)
798 public override void Reverse(
int index,
int count)
818 return _list.
GetRange(index, count);
822 public override void Sort()
834 _list.
Sort(comparer);
838 public override void Sort(
int index,
int count,
IComparer comparer)
842 _list.
Sort(index, count, comparer);
846 public override object[]
ToArray()
876 private object _root;
878 public virtual int Count 895 public virtual object this[
int index]
908 _list[index] = value;
913 public virtual object SyncRoot => _root;
915 internal SyncIList(
IList list)
918 _root = list.SyncRoot;
921 public virtual int Add(
object value)
925 return _list.
Add(value);
929 public virtual void Clear()
937 public virtual bool Contains(
object item)
949 _list.
CopyTo(array, index);
961 public virtual int IndexOf(
object value)
969 public virtual void Insert(
int index,
object value)
973 _list.
Insert(index, value);
977 public virtual void Remove(
object value)
985 public virtual void RemoveAt(
int index)
1007 public virtual object this[
int index]
1011 return _list[index];
1015 _list[index] = value;
1021 internal FixedSizeList(
IList l)
1026 public virtual int Add(
object obj)
1031 public virtual void Clear()
1036 public virtual bool Contains(
object obj)
1041 public virtual void CopyTo(
Array array,
int index)
1043 _list.
CopyTo(array, index);
1051 public virtual int IndexOf(
object value)
1056 public virtual void Insert(
int index,
object obj)
1061 public virtual void Remove(
object value)
1066 public virtual void RemoveAt(
int index)
1073 private class FixedSizeArrayList :
ArrayList 1085 public override object this[
int index]
1089 return _list[index];
1093 _list[index] = value;
1094 _version = _list._version;
1112 internal FixedSizeArrayList(
ArrayList l)
1115 _version = _list._version;
1118 public override int Add(
object obj)
1130 return _list.
BinarySearch(index, count, value, comparer);
1133 public override void Clear()
1138 public override object Clone()
1140 FixedSizeArrayList fixedSizeArrayList =
new FixedSizeArrayList(_list);
1142 return fixedSizeArrayList;
1145 public override bool Contains(
object obj)
1150 public override void CopyTo(
Array array,
int index)
1152 _list.
CopyTo(array, index);
1155 public override void CopyTo(
int index,
Array array,
int arrayIndex,
int count)
1157 _list.
CopyTo(index, array, arrayIndex, count);
1170 public override int IndexOf(
object value)
1175 public override int IndexOf(
object value,
int startIndex)
1177 return _list.
IndexOf(value, startIndex);
1180 public override int IndexOf(
object value,
int startIndex,
int count)
1182 return _list.
IndexOf(value, startIndex, count);
1185 public override void Insert(
int index,
object obj)
1200 public override int LastIndexOf(
object value,
int startIndex)
1205 public override int LastIndexOf(
object value,
int startIndex,
int count)
1207 return _list.
LastIndexOf(value, startIndex, count);
1210 public override void Remove(
object value)
1215 public override void RemoveAt(
int index)
1220 public override void RemoveRange(
int index,
int count)
1228 _version = _list._version;
1233 if (index < 0 || count < 0)
1237 if (
Count - index < count)
1241 return new Range(
this, index, count);
1244 public override void Reverse(
int index,
int count)
1247 _version = _list._version;
1250 public override void Sort(
int index,
int count,
IComparer comparer)
1252 _list.
Sort(index, count, comparer);
1253 _version = _list._version;
1256 public override object[]
ToArray()
1275 private IList _list;
1285 public virtual object this[
int index]
1289 return _list[index];
1299 internal ReadOnlyList(
IList l)
1304 public virtual int Add(
object obj)
1309 public virtual void Clear()
1314 public virtual bool Contains(
object obj)
1319 public virtual void CopyTo(
Array array,
int index)
1321 _list.
CopyTo(array, index);
1329 public virtual int IndexOf(
object value)
1334 public virtual void Insert(
int index,
object obj)
1339 public virtual void Remove(
object value)
1344 public virtual void RemoveAt(
int index)
1351 private class ReadOnlyArrayList :
ArrayList 1363 public override object this[
int index]
1367 return _list[index];
1394 public override int Add(
object obj)
1406 return _list.
BinarySearch(index, count, value, comparer);
1409 public override void Clear()
1414 public override object Clone()
1416 ReadOnlyArrayList readOnlyArrayList =
new ReadOnlyArrayList(_list);
1418 return readOnlyArrayList;
1421 public override bool Contains(
object obj)
1426 public override void CopyTo(
Array array,
int index)
1428 _list.
CopyTo(array, index);
1431 public override void CopyTo(
int index,
Array array,
int arrayIndex,
int count)
1433 _list.
CopyTo(index, array, arrayIndex, count);
1446 public override int IndexOf(
object value)
1451 public override int IndexOf(
object value,
int startIndex)
1453 return _list.
IndexOf(value, startIndex);
1456 public override int IndexOf(
object value,
int startIndex,
int count)
1458 return _list.
IndexOf(value, startIndex, count);
1461 public override void Insert(
int index,
object obj)
1476 public override int LastIndexOf(
object value,
int startIndex)
1481 public override int LastIndexOf(
object value,
int startIndex,
int count)
1483 return _list.
LastIndexOf(value, startIndex, count);
1486 public override void Remove(
object value)
1491 public override void RemoveAt(
int index)
1496 public override void RemoveRange(
int index,
int count)
1508 if (index < 0 || count < 0)
1512 if (
Count - index < count)
1516 return new Range(
this, index, count);
1519 public override void Reverse(
int index,
int count)
1524 public override void Sort(
int index,
int count,
IComparer comparer)
1529 public override object[]
ToArray()
1552 private int endIndex;
1554 private int version;
1556 private object currentElement;
1558 private int startIndex;
1560 public object Current
1564 if (index < startIndex)
1568 if (index > endIndex)
1572 return currentElement;
1576 internal ArrayListEnumerator(
ArrayList list,
int index,
int count)
1580 this.index = index - 1;
1581 endIndex = this.index + count;
1582 version = list._version;
1583 currentElement =
null;
1586 public object Clone()
1588 return MemberwiseClone();
1591 public bool MoveNext()
1593 if (version != list._version)
1597 if (index < endIndex)
1599 currentElement = list[++index];
1602 index = endIndex + 1;
1608 if (version != list._version)
1612 index = startIndex - 1;
1621 private int _baseIndex;
1623 private int _baseSize;
1625 private int _baseVersion;
1642 public override int Count 1646 InternalUpdateRange();
1659 public override object this[
int index]
1663 InternalUpdateRange();
1664 if (index < 0 || index >= _baseSize)
1668 return _baseList[_baseIndex + index];
1672 InternalUpdateRange();
1673 if (index < 0 || index >= _baseSize)
1677 _baseList[_baseIndex + index] = value;
1678 InternalUpdateVersion();
1682 internal Range(
ArrayList list,
int index,
int count)
1683 : base(trash:
false)
1688 _baseVersion = list._version;
1689 _version = list._version;
1692 private void InternalUpdateRange()
1694 if (_baseVersion != _baseList._version)
1700 private void InternalUpdateVersion()
1706 public override int Add(
object value)
1708 InternalUpdateRange();
1709 _baseList.
Insert(_baseIndex + _baseSize, value);
1710 InternalUpdateVersion();
1720 InternalUpdateRange();
1721 int count = c.
Count;
1725 InternalUpdateVersion();
1732 if (index < 0 || count < 0)
1736 if (_baseSize - index < count)
1740 InternalUpdateRange();
1741 int num = _baseList.
BinarySearch(_baseIndex + index, count, value, comparer);
1744 return num - _baseIndex;
1746 return num + _baseIndex;
1749 public override void Clear()
1751 InternalUpdateRange();
1755 InternalUpdateVersion();
1760 public override object Clone()
1762 InternalUpdateRange();
1763 Range range =
new Range(_baseList, _baseIndex, _baseSize);
1768 public override bool Contains(
object item)
1770 InternalUpdateRange();
1773 for (
int i = 0; i < _baseSize; i++)
1775 if (_baseList[_baseIndex + i] ==
null)
1782 for (
int j = 0; j < _baseSize; j++)
1784 if (_baseList[_baseIndex + j] !=
null && _baseList[_baseIndex + j].Equals(item))
1792 public override void CopyTo(
Array array,
int index)
1798 if (array.Rank != 1)
1806 if (array.Length - index < _baseSize)
1810 InternalUpdateRange();
1811 _baseList.
CopyTo(_baseIndex, array, index, _baseSize);
1814 public override void CopyTo(
int index,
Array array,
int arrayIndex,
int count)
1820 if (array.Rank != 1)
1824 if (index < 0 || count < 0)
1828 if (array.Length - arrayIndex < count)
1832 if (_baseSize - index < count)
1836 InternalUpdateRange();
1837 _baseList.
CopyTo(_baseIndex + index, array, arrayIndex, count);
1847 if (index < 0 || count < 0)
1851 if (_baseSize - index < count)
1855 InternalUpdateRange();
1861 if (index < 0 || count < 0)
1865 if (_baseSize - index < count)
1869 InternalUpdateRange();
1870 return new Range(
this, index, count);
1873 public override int IndexOf(
object value)
1875 InternalUpdateRange();
1876 int num = _baseList.
IndexOf(value, _baseIndex, _baseSize);
1879 return num - _baseIndex;
1884 public override int IndexOf(
object value,
int startIndex)
1890 if (startIndex > _baseSize)
1894 InternalUpdateRange();
1895 int num = _baseList.
IndexOf(value, _baseIndex + startIndex, _baseSize - startIndex);
1898 return num - _baseIndex;
1903 public override int IndexOf(
object value,
int startIndex,
int count)
1905 if (startIndex < 0 || startIndex > _baseSize)
1909 if (count < 0 || startIndex > _baseSize - count)
1913 InternalUpdateRange();
1914 int num = _baseList.
IndexOf(value, _baseIndex + startIndex, count);
1917 return num - _baseIndex;
1922 public override void Insert(
int index,
object value)
1924 if (index < 0 || index > _baseSize)
1928 InternalUpdateRange();
1929 _baseList.
Insert(_baseIndex + index, value);
1930 InternalUpdateVersion();
1936 if (index < 0 || index > _baseSize)
1944 InternalUpdateRange();
1945 int count = c.
Count;
1950 InternalUpdateVersion();
1956 InternalUpdateRange();
1957 int num = _baseList.
LastIndexOf(value, _baseIndex + _baseSize - 1, _baseSize);
1960 return num - _baseIndex;
1965 public override int LastIndexOf(
object value,
int startIndex)
1967 return LastIndexOf(value, startIndex, startIndex + 1);
1970 public override int LastIndexOf(
object value,
int startIndex,
int count)
1972 InternalUpdateRange();
1977 if (startIndex >= _baseSize)
1985 int num = _baseList.
LastIndexOf(value, _baseIndex + startIndex, count);
1988 return num - _baseIndex;
1993 public override void RemoveAt(
int index)
1995 if (index < 0 || index >= _baseSize)
1999 InternalUpdateRange();
2000 _baseList.
RemoveAt(_baseIndex + index);
2001 InternalUpdateVersion();
2005 public override void RemoveRange(
int index,
int count)
2007 if (index < 0 || count < 0)
2011 if (_baseSize - index < count)
2015 InternalUpdateRange();
2019 InternalUpdateVersion();
2024 public override void Reverse(
int index,
int count)
2026 if (index < 0 || count < 0)
2030 if (_baseSize - index < count)
2034 InternalUpdateRange();
2035 _baseList.
Reverse(_baseIndex + index, count);
2036 InternalUpdateVersion();
2041 InternalUpdateRange();
2042 if (index < 0 || index >= _baseSize)
2046 _baseList.
SetRange(_baseIndex + index, c);
2049 InternalUpdateVersion();
2053 public override void Sort(
int index,
int count,
IComparer comparer)
2055 if (index < 0 || count < 0)
2059 if (_baseSize - index < count)
2063 InternalUpdateRange();
2064 _baseList.
Sort(_baseIndex + index, count, comparer);
2065 InternalUpdateVersion();
2068 public override object[]
ToArray()
2070 InternalUpdateRange();
2071 object[] array =
new object[_baseSize];
2072 Array.
Copy(_baseList._items, _baseIndex, array, 0, _baseSize);
2076 [SecuritySafeCritical]
2083 InternalUpdateRange();
2084 Array array =
Array.UnsafeCreateInstance(type, _baseSize);
2085 _baseList.
CopyTo(_baseIndex, array, 0, _baseSize);
2102 private int version;
2104 private object currentElement;
2107 private bool isArrayList;
2109 private static object dummyObject =
new object();
2111 public object Current
2115 object obj = currentElement;
2116 if (dummyObject == obj)
2128 internal ArrayListEnumeratorSimple(
ArrayList list)
2132 version = list._version;
2133 isArrayList = (list.GetType() == typeof(
ArrayList));
2134 currentElement = dummyObject;
2137 public object Clone()
2139 return MemberwiseClone();
2142 public bool MoveNext()
2144 if (version != list._version)
2150 if (index < list._size - 1)
2152 currentElement = list._items[++index];
2155 currentElement = dummyObject;
2159 if (index < list.Count - 1)
2161 currentElement = list[++index];
2165 currentElement = dummyObject;
2171 if (version != list._version)
2175 currentElement = dummyObject;
2180 internal class ArrayListDebugView
2185 public object[] Items
2193 public ArrayListDebugView(
ArrayList arrayList)
2195 if (arrayList ==
null)
2199 this.arrayList = arrayList;
2203 private object[] _items;
2207 private int _version;
2210 private object _syncRoot;
2212 private const int _defaultCapacity = 4;
2214 private static readonly
object[] emptyArray = EmptyArray<object>.Value;
2225 return _items.Length;
2233 if (value == _items.Length)
2239 object[] array =
new object[value];
2248 _items =
new object[4];
2278 if (_syncRoot ==
null)
2292 public virtual object this[
int index]
2296 if (index < 0 || index >= _size)
2300 return _items[index];
2304 if (index < 0 || index >= _size)
2308 _items[index] = value;
2320 _items = emptyArray;
2335 _items = emptyArray;
2339 _items =
new object[capacity];
2353 int count = c.
Count;
2356 _items = emptyArray;
2359 _items =
new object[count];
2374 return new IListWrapper(list);
2381 public virtual int Add(
object value)
2383 if (_size == _items.Length)
2385 EnsureCapacity(_size + 1);
2387 _items[_size] = value;
2427 if (_size - index < count)
2476 arrayList._size = _size;
2477 arrayList._version = _version;
2478 Array.
Copy(_items, 0, arrayList._items, 0, _size);
2490 for (
int i = 0; i < _size; i++)
2492 if (_items[i] ==
null)
2499 for (
int j = 0; j < _size; j++)
2501 if (_items[j] !=
null && _items[j].Equals(item))
2533 if (array !=
null && array.Rank != 1)
2537 Array.
Copy(_items, 0, array, arrayIndex, _size);
2555 public virtual void CopyTo(
int index,
Array array,
int arrayIndex,
int count)
2557 if (_size - index < count)
2561 if (array !=
null && array.Rank != 1)
2565 Array.
Copy(_items, index, array, arrayIndex, count);
2568 private void EnsureCapacity(
int min)
2570 if (_items.Length < min)
2572 int num = (_items.Length == 0) ? 4 : (_items.Length * 2);
2573 if ((uint)num > 2146435071u)
2596 return new FixedSizeList(list);
2610 return new FixedSizeArrayList(list);
2617 return new ArrayListEnumeratorSimple(
this);
2639 if (_size - index < count)
2643 return new ArrayListEnumerator(
this, index, count);
2651 return Array.IndexOf((
Array)_items, value, 0, _size);
2660 public virtual int IndexOf(
object value,
int startIndex)
2662 if (startIndex > _size)
2666 return Array.IndexOf((
Array)_items, value, startIndex, _size - startIndex);
2678 public virtual int IndexOf(
object value,
int startIndex,
int count)
2680 if (startIndex > _size)
2684 if (count < 0 || startIndex > _size - count)
2688 return Array.IndexOf((
Array)_items, value, startIndex, count);
2698 public virtual void Insert(
int index,
object value)
2700 if (index < 0 || index > _size)
2704 if (_size == _items.Length)
2706 EnsureCapacity(_size + 1);
2710 Array.
Copy(_items, index, _items, index + 1, _size - index);
2712 _items[index] = value;
2732 if (index < 0 || index > _size)
2736 int count = c.
Count;
2739 EnsureCapacity(_size + count);
2742 Array.
Copy(_items, index, _items, index + count, _size - index);
2744 object[] array =
new object[count];
2746 array.CopyTo(_items, index);
2768 if (startIndex >= _size)
2772 return LastIndexOf(value, startIndex, startIndex + 1);
2784 public virtual int LastIndexOf(
object value,
int startIndex,
int count)
2786 if (
Count != 0 && (startIndex < 0 || count < 0))
2794 if (startIndex >= _size || count > startIndex + 1)
2812 return new ReadOnlyList(list);
2826 return new ReadOnlyArrayList(list);
2849 if (index < 0 || index >= _size)
2856 Array.
Copy(_items, index + 1, _items, index, _size - index);
2858 _items[_size] =
null;
2881 if (_size - index < count)
2891 Array.
Copy(_items, index + count, _items, index, _size - index);
2895 _items[--num] =
null;
2914 for (
int i = 0; i < count; i++)
2916 arrayList.
Add(value);
2947 if (_size - index < count)
2970 int count = c.
Count;
2971 if (index < 0 || index > _size - count)
2993 if (index < 0 || count < 0)
2997 if (_size - index < count)
3001 return new Range(
this, index, count);
3043 if (_size - index < count)
3047 Array.
Sort(_items, index, count, comparer);
3056 [HostProtection(
SecurityAction.LinkDemand, Synchronization =
true)]
3063 return new SyncIList(list);
3071 [HostProtection(
SecurityAction.LinkDemand, Synchronization =
true)]
3078 return new SyncArrayList(list);
3085 object[] array =
new object[_size];
3096 [SecuritySafeCritical]
3103 Array array =
Array.UnsafeCreateInstance(type, _size);
static ArrayList ReadOnly(ArrayList list)
Returns a read-only T:System.Collections.ArrayList wrapper.
virtual bool IsFixedSize
Gets a value indicating whether the T:System.Collections.ArrayList has a fixed size.
virtual int IndexOf(object value, int startIndex, int count)
Searches for the specified T:System.Object and returns the zero-based index of the first occurrence w...
virtual void CopyTo(Array array, int arrayIndex)
Copies the entire T:System.Collections.ArrayList to a compatible one-dimensional T:System....
object SyncRoot
Gets an object that can be used to synchronize access to the T:System.Collections....
Compares two objects for equivalence, where string comparisons are case-sensitive.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
ArrayList(int capacity)
Initializes a new instance of the T:System.Collections.ArrayList class that is empty and has the spec...
bool MoveNext()
Advances the enumerator to the next element of the collection.
virtual int LastIndexOf(object value, int startIndex)
Searches for the specified T:System.Object and returns the zero-based index of the last occurrence wi...
virtual void Insert(int index, object value)
Inserts an element into the T:System.Collections.ArrayList at the specified index.
virtual void Sort(int index, int count, IComparer comparer)
Sorts the elements in a range of elements in T:System.Collections.ArrayList using the specified compa...
virtual void TrimToSize()
Sets the capacity to the actual number of elements in the T:System.Collections.ArrayList.
static void Clear(Array array, int index, int length)
Sets a range of elements in an array to the default value of each element type.
virtual void RemoveAt(int index)
Removes the element at the specified index of the T:System.Collections.ArrayList.
ArrayList()
Initializes a new instance of the T:System.Collections.ArrayList class that is empty and has the defa...
Represents a non-generic collection of objects that can be individually accessed by index.
static IList Synchronized(IList list)
Returns an T:System.Collections.IList wrapper that is synchronized (thread safe).
virtual IEnumerator GetEnumerator(int index, int count)
Returns an enumerator for a range of elements in the T:System.Collections.ArrayList.
void RemoveAt(int index)
Removes the T:System.Collections.IList item at the specified index.
virtual int IndexOf(object value, int startIndex)
Searches for the specified T:System.Object and returns the zero-based index of the first occurrence w...
void Insert(int index, object value)
Inserts an item to the T:System.Collections.IList at the specified index.
static void Reverse(Array array)
Reverses the sequence of the elements in the entire one-dimensional T:System.Array.
virtual int Count
Gets the number of elements actually contained in the T:System.Collections.ArrayList.
The exception that is thrown when the value of an argument is outside the allowable range of values a...
virtual void InsertRange(int index, ICollection c)
Inserts the elements of a collection into the T:System.Collections.ArrayList at the specified index.
bool IsReadOnly
Gets a value indicating whether the T:System.Collections.IList is read-only.
virtual int LastIndexOf(object value)
Searches for the specified T:System.Object and returns the zero-based index of the last occurrence wi...
virtual void Reverse(int index, int count)
Reverses the order of the elements in the specified range.
void Clear()
Removes all items from the T:System.Collections.IList.
int IndexOf(object value)
Determines the index of a specific item in the T:System.Collections.IList.
virtual void Clear()
Removes all elements from the T:System.Collections.ArrayList.
virtual object Clone()
Creates a shallow copy of the T:System.Collections.ArrayList.
bool IsFixedSize
Gets a value indicating whether the T:System.Collections.IList has a fixed size.
static ArrayList Synchronized(ArrayList list)
Returns an T:System.Collections.ArrayList wrapper that is synchronized (thread safe).
virtual bool IsSynchronized
Gets a value indicating whether access to the T:System.Collections.ArrayList is synchronized (thread ...
int Compare(object x, object y)
Compares two objects and returns a value indicating whether one is less than, equal to,...
SecurityAction
Specifies the security actions that can be performed using declarative security.
Exposes an enumerator, which supports a simple iteration over a non-generic collection....
Provides information about, and means to manipulate, the current environment and platform....
virtual void Sort(IComparer comparer)
Sorts the elements in the entire T:System.Collections.ArrayList using the specified comparer.
virtual bool IsReadOnly
Gets a value indicating whether the T:System.Collections.ArrayList is read-only.
static void Sort(Array array)
Sorts the elements in an entire one-dimensional T:System.Array using the T:System....
virtual bool Contains(object item)
Determines whether an element is in the T:System.Collections.ArrayList.
virtual void AddRange(ICollection c)
Adds the elements of an T:System.Collections.ICollection to the end of the T:System....
static int CompareExchange(ref int location1, int value, int comparand)
Compares two 32-bit signed integers for equality and, if they are equal, replaces the first value.
static readonly Comparer Default
Represents an instance of T:System.Collections.Comparer that is associated with the P:System....
object Current
Gets the element in the collection at the current position of the enumerator.
Supports cloning, which creates a new instance of a class with the same value as an existing instance...
Exposes a method that compares two objects.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
bool IsSynchronized
Gets a value indicating whether access to the T:System.Collections.ICollection is synchronized (threa...
Represents type declarations: class types, interface types, array types, value types,...
virtual int BinarySearch(int index, int count, object value, IComparer comparer)
Searches a range of elements in the sorted T:System.Collections.ArrayList for an element using the sp...
int Add(object value)
Adds an item to the T:System.Collections.IList.
virtual void CopyTo(Array array)
Copies the entire T:System.Collections.ArrayList to a compatible one-dimensional T:System....
virtual object SyncRoot
Gets an object that can be used to synchronize access to the T:System.Collections....
virtual void RemoveRange(int index, int count)
Removes a range of elements from the T:System.Collections.ArrayList.
static int BinarySearch(Array array, object value)
Searches an entire one-dimensional sorted array for a specific element, using the T:System....
IEnumerator GetEnumerator()
Returns an enumerator that iterates through a collection.
virtual int Add(object value)
Adds an object to the end of the T:System.Collections.ArrayList.
static ArrayList Repeat(object value, int count)
Returns an T:System.Collections.ArrayList whose elements are copies of the specified value.
virtual void Reverse()
Reverses the order of the elements in the entire T:System.Collections.ArrayList.
static IList FixedSize(IList list)
Returns an T:System.Collections.IList wrapper with a fixed size.
virtual int LastIndexOf(object value, int startIndex, int count)
Searches for the specified T:System.Object and returns the zero-based index of the last occurrence wi...
The exception that is thrown when one of the arguments provided to a method is not valid.
static void Copy(Array sourceArray, Array destinationArray, int length)
Copies a range of elements from an T:System.Array starting at the first element and pastes them into ...
virtual int BinarySearch(object value)
Searches the entire sorted T:System.Collections.ArrayList for an element using the default comparer a...
virtual void Remove(object obj)
Removes the first occurrence of a specific object from the T:System.Collections.ArrayList.
virtual int BinarySearch(object value, IComparer comparer)
Searches the entire sorted T:System.Collections.ArrayList for an element using the specified comparer...
virtual IEnumerator GetEnumerator()
Returns an enumerator for the entire T:System.Collections.ArrayList.
virtual void SetRange(int index, ICollection c)
Copies the elements of a collection over a range of elements in the T:System.Collections....
The exception that is thrown when a method call is invalid for the object's current state.
void Remove(object value)
Removes the first occurrence of a specific object from the T:System.Collections.IList.
static int LastIndexOf(Array array, object value)
Searches for the specified object and returns the index of the last occurrence within the entire one-...
bool Contains(object value)
Determines whether the T:System.Collections.IList contains a specific value.
int Count
Gets the number of elements contained in the T:System.Collections.ICollection.
The exception that is thrown when an invoked method is not supported, or when there is an attempt to ...
virtual void CopyTo(int index, Array array, int arrayIndex, int count)
Copies a range of elements from the T:System.Collections.ArrayList to a compatible one-dimensional T:...
Defines size, enumerators, and synchronization methods for all nongeneric collections.
virtual int IndexOf(object value)
Searches for the specified T:System.Object and returns the zero-based index of the first occurrence w...
virtual Array ToArray(Type type)
Copies the elements of the T:System.Collections.ArrayList to a new array of the specified element typ...
virtual int Capacity
Gets or sets the number of elements that the T:System.Collections.ArrayList can contain.
void CopyTo(Array array, int index)
Copies the elements of the T:System.Collections.ICollection to an T:System.Array, starting at a parti...
static IList ReadOnly(IList list)
Returns a read-only T:System.Collections.IList wrapper.
DebuggerBrowsableState
Provides display instructions for the debugger.
virtual ArrayList GetRange(int index, int count)
Returns an T:System.Collections.ArrayList which represents a subset of the elements in the source T:S...
static ArrayList FixedSize(ArrayList list)
Returns an T:System.Collections.ArrayList wrapper with a fixed size.
Provides atomic operations for variables that are shared by multiple threads.
static ArrayList Adapter(IList list)
Creates an T:System.Collections.ArrayList wrapper for a specific T:System.Collections....
Supports a simple iteration over a non-generic collection.
ArrayList(ICollection c)
Initializes a new instance of the T:System.Collections.ArrayList class that contains elements copied ...
virtual object [] ToArray()
Copies the elements of the T:System.Collections.ArrayList to a new T:System.Object array.
Implements the T:System.Collections.IList interface using an array whose size is dynamically increase...
virtual void Sort()
Sorts the elements in the entire T:System.Collections.ArrayList.