16 [__DynamicallyInvokable]
19 internal sealed
class FunctorComparer<
T> :
IComparer<T>
21 private Comparison<T> comparison;
23 public FunctorComparer(Comparison<T> comparison)
25 this.comparison = comparison;
28 public int Compare(
T x,
T y)
30 return comparison(x, y);
34 private struct SorterObjectArray
36 private object[] keys;
38 private object[] items;
42 internal SorterObjectArray(
object[] keys,
object[] items,
IComparer comparer)
50 this.comparer = comparer;
53 internal void SwapIfGreaterWithItems(
int a,
int b)
55 if (a != b && comparer.
Compare(keys[a], keys[b]) > 0)
62 object obj2 = items[a];
69 private void Swap(
int i,
int j)
76 object obj2 = items[i];
82 internal void Sort(
int left,
int length)
84 if (BinaryCompatibility.TargetsAtLeast_Desktop_V4_5)
86 IntrospectiveSort(left, length);
90 DepthLimitedQuickSort(left, length + left - 1, 32);
94 private void DepthLimitedQuickSort(
int left,
int right,
int depthLimit)
96 while (depthLimit != 0)
100 int median = GetMedian(i, num);
103 SwapIfGreaterWithItems(i, median);
104 SwapIfGreaterWithItems(i, num);
105 SwapIfGreaterWithItems(median, num);
111 object obj = keys[median];
116 for (; comparer.
Compare(keys[i], obj) < 0; i++)
119 while (comparer.
Compare(obj, keys[num]) < 0)
138 object obj2 = keys[i];
143 object obj3 = items[i];
144 items[i] = items[num];
153 if (num - left <= right - i)
157 DepthLimitedQuickSort(left, num, depthLimit);
165 DepthLimitedQuickSort(i, right, depthLimit);
176 Heapsort(left, right);
188 private void IntrospectiveSort(
int left,
int length)
194 IntroSort(left, length + left - 1, 2 * IntrospectiveSortUtilities.FloorLog2(keys.Length));
198 IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer(comparer);
207 private void IntroSort(
int lo,
int hi,
int depthLimit)
215 int num = hi - lo + 1;
223 SwapIfGreaterWithItems(lo, hi);
226 SwapIfGreaterWithItems(lo, hi - 1);
227 SwapIfGreaterWithItems(lo, hi);
228 SwapIfGreaterWithItems(hi - 1, hi);
231 InsertionSort(lo, hi);
241 int num2 = PickPivotAndPartition(lo, hi);
242 IntroSort(num2 + 1, hi, depthLimit);
248 private int PickPivotAndPartition(
int lo,
int hi)
250 int num = lo + (hi - lo) / 2;
251 SwapIfGreaterWithItems(lo, num);
252 SwapIfGreaterWithItems(lo, hi);
253 SwapIfGreaterWithItems(num, hi);
254 object obj = keys[num];
260 while (comparer.
Compare(keys[++num2], obj) < 0)
263 while (comparer.
Compare(obj, keys[--num3]) < 0)
276 private void Heapsort(
int lo,
int hi)
278 int num = hi - lo + 1;
279 for (
int num2 = num / 2; num2 >= 1; num2--)
281 DownHeap(num2, num, lo);
283 for (
int num3 = num; num3 > 1; num3--)
285 Swap(lo, lo + num3 - 1);
286 DownHeap(1, num3 - 1, lo);
290 private void DownHeap(
int i,
int n,
int lo)
292 object obj = keys[lo + i - 1];
293 object obj2 = (items !=
null) ? items[lo + i - 1] :
null;
297 if (num < n && comparer.
Compare(keys[lo + num - 1], keys[lo + num]) < 0)
301 if (comparer.
Compare(obj, keys[lo + num - 1]) >= 0)
305 keys[lo + i - 1] = keys[lo + num - 1];
308 items[lo + i - 1] = items[lo + num - 1];
312 keys[lo + i - 1] = obj;
315 items[lo + i - 1] = obj2;
319 private void InsertionSort(
int lo,
int hi)
321 for (
int i = lo; i < hi; i++)
324 object obj = keys[i + 1];
325 object obj2 = (items !=
null) ? items[i + 1] :
null;
326 while (num >= lo && comparer.
Compare(obj, keys[num]) < 0)
328 keys[num + 1] = keys[num];
331 items[num + 1] = items[num];
338 items[num + 1] = obj2;
344 private struct SorterGenericArray
354 if (comparer ==
null)
360 this.comparer = comparer;
363 internal void SwapIfGreaterWithItems(
int a,
int b)
379 private void Swap(
int i,
int j)
392 internal void Sort(
int left,
int length)
394 if (BinaryCompatibility.TargetsAtLeast_Desktop_V4_5)
396 IntrospectiveSort(left, length);
400 DepthLimitedQuickSort(left, length + left - 1, 32);
404 private void DepthLimitedQuickSort(
int left,
int right,
int depthLimit)
406 while (depthLimit != 0)
410 int median = GetMedian(i, num);
413 SwapIfGreaterWithItems(i, median);
414 SwapIfGreaterWithItems(i, num);
415 SwapIfGreaterWithItems(median, num);
421 object value = keys.
GetValue(median);
458 if (i !=
int.MaxValue)
462 if (num !=
int.MinValue)
469 if (num - left <= right - i)
473 DepthLimitedQuickSort(left, num, depthLimit);
481 DepthLimitedQuickSort(i, right, depthLimit);
492 Heapsort(left, right);
504 private void IntrospectiveSort(
int left,
int length)
510 IntroSort(left, length + left - 1, 2 * IntrospectiveSortUtilities.FloorLog2(keys.
Length));
514 IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer(comparer);
523 private void IntroSort(
int lo,
int hi,
int depthLimit)
531 int num = hi - lo + 1;
539 SwapIfGreaterWithItems(lo, hi);
542 SwapIfGreaterWithItems(lo, hi - 1);
543 SwapIfGreaterWithItems(lo, hi);
544 SwapIfGreaterWithItems(hi - 1, hi);
547 InsertionSort(lo, hi);
557 int num2 = PickPivotAndPartition(lo, hi);
558 IntroSort(num2 + 1, hi, depthLimit);
564 private int PickPivotAndPartition(
int lo,
int hi)
566 int num = lo + (hi - lo) / 2;
567 SwapIfGreaterWithItems(lo, num);
568 SwapIfGreaterWithItems(lo, hi);
569 SwapIfGreaterWithItems(num, hi);
592 private void Heapsort(
int lo,
int hi)
594 int num = hi - lo + 1;
595 for (
int num2 = num / 2; num2 >= 1; num2--)
597 DownHeap(num2, num, lo);
599 for (
int num3 = num; num3 > 1; num3--)
601 Swap(lo, lo + num3 - 1);
602 DownHeap(1, num3 - 1, lo);
606 private void DownHeap(
int i,
int n,
int lo)
608 object value = keys.
GetValue(lo + i - 1);
609 object value2 = (items !=
null) ? items.
GetValue(lo + i - 1) :
null;
635 private void InsertionSort(
int lo,
int hi)
637 for (
int i = lo; i < hi; i++)
640 object value = keys.
GetValue(i + 1);
641 object value2 = (items !=
null) ? items.
GetValue(i + 1) :
null;
663 private Array _array;
667 private int _endIndex;
669 public object Current
677 if (_index >= _endIndex)
681 return _array.GetValue(_index);
685 internal SZArrayEnumerator(
Array array)
689 _endIndex = array.Length;
692 public object Clone()
694 return MemberwiseClone();
697 public bool MoveNext()
699 if (_index < _endIndex)
702 return _index < _endIndex;
720 private int endIndex;
722 private int startIndex;
724 private int[] _indices;
726 private bool _complete;
728 public object Current
732 if (index < startIndex)
740 return array.GetValue(_indices);
744 internal ArrayEnumerator(
Array array,
int index,
int count)
747 this.index = index - 1;
749 endIndex = index + count;
750 _indices =
new int[array.Rank];
752 for (
int i = 0; i < array.Rank; i++)
754 _indices[i] = array.GetLowerBound(i);
755 num *= array.GetLength(i);
757 _indices[_indices.Length - 1]--;
758 _complete = (num == 0);
761 private void IncArray()
763 int rank = array.Rank;
764 _indices[rank - 1]++;
772 if (_indices[num] > array.GetUpperBound(num))
778 for (
int i = num; i < rank; i++)
780 _indices[i] = array.GetLowerBound(i);
789 public object Clone()
791 return MemberwiseClone();
794 public bool MoveNext()
808 index = startIndex - 1;
810 for (
int i = 0; i < array.Rank; i++)
812 _indices[i] = array.GetLowerBound(i);
813 num *= array.GetLength(i);
815 _complete = (num == 0);
816 _indices[_indices.Length - 1]--;
820 internal const int MaxArrayLength = 2146435071;
822 internal const int MaxByteArrayLength = 2147483591;
827 [__DynamicallyInvokable]
831 [SecuritySafeCritical]
832 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
833 [__DynamicallyInvokable]
843 [SecuritySafeCritical]
844 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
850 [__DynamicallyInvokable]
854 [SecuritySafeCritical]
855 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
856 [__DynamicallyInvokable]
862 [__DynamicallyInvokable]
865 [__DynamicallyInvokable]
895 [__DynamicallyInvokable]
896 object IList.this[
int index]
898 [__DynamicallyInvokable]
903 [__DynamicallyInvokable]
935 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
936 [__DynamicallyInvokable]
946 array =
new T[newSize];
948 else if (array2.Length != newSize)
950 T[] array3 =
new T[newSize];
951 Copy(array2, 0, array3, 0, (array2.Length > newSize) ? newSize : array2.Length);
970 [SecuritySafeCritical]
971 [__DynamicallyInvokable]
974 if ((
object)elementType ==
null)
983 if (runtimeType ==
null)
987 return InternalCreate((
void*)runtimeType.TypeHandle.Value, 1, &length,
null);
1006 [SecuritySafeCritical]
1009 if ((
object)elementType ==
null)
1013 if (length1 < 0 || length2 < 0)
1018 if (runtimeType ==
null)
1022 int* ptr = stackalloc
int[2];
1025 return InternalCreate((
void*)runtimeType.TypeHandle.Value, 2, ptr,
null);
1046 [SecuritySafeCritical]
1049 if ((
object)elementType ==
null)
1066 if (runtimeType ==
null)
1070 int* ptr = stackalloc
int[3];
1074 return InternalCreate((
void*)runtimeType.TypeHandle.Value, 3, ptr,
null);
1091 [SecuritySafeCritical]
1092 [__DynamicallyInvokable]
1095 if ((
object)elementType ==
null)
1099 if (lengths ==
null)
1103 if (lengths.Length == 0)
1108 if (runtimeType ==
null)
1112 for (
int i = 0; i < lengths.Length; i++)
1119 fixed (
int* pLengths = lengths)
1121 return InternalCreate((
void*)runtimeType.TypeHandle.Value, lengths.Length, pLengths,
null);
1141 if (lengths ==
null)
1145 if (lengths.Length == 0)
1149 int[] array =
new int[lengths.Length];
1150 for (
int i = 0; i < lengths.Length; i++)
1152 long num = lengths[i];
1153 if (num >
int.MaxValue || num <
int.MinValue)
1157 array[i] = (int)num;
1178 [SecuritySafeCritical]
1179 [__DynamicallyInvokable]
1182 if (elementType ==
null)
1186 if (lengths ==
null)
1190 if (lowerBounds ==
null)
1194 if (lengths.Length != lowerBounds.Length)
1198 if (lengths.Length == 0)
1203 if (runtimeType ==
null)
1207 for (
int i = 0; i < lengths.Length; i++)
1214 fixed (
int* pLengths = lengths)
1216 fixed (
int* pLowerBounds = lowerBounds)
1218 return InternalCreate((
void*)runtimeType.TypeHandle.Value, lengths.Length, pLengths, pLowerBounds);
1225 private unsafe
static extern Array InternalCreate(
void* elementType,
int rank,
int* pLengths,
int* pLowerBounds);
1229 internal static Array UnsafeCreateInstance(
Type elementType,
int length)
1236 internal static Array UnsafeCreateInstance(Type elementType,
int length1,
int length2)
1243 internal static Array UnsafeCreateInstance(Type elementType, params
int[] lengths)
1250 internal static Array UnsafeCreateInstance(Type elementType,
int[] lengths,
int[] lowerBounds)
1272 [SecuritySafeCritical]
1273 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
1274 [__DynamicallyInvokable]
1277 if (sourceArray ==
null)
1281 if (destinationArray ==
null)
1309 [SecuritySafeCritical]
1310 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
1311 [__DynamicallyInvokable]
1312 public static void Copy(
Array sourceArray,
int sourceIndex,
Array destinationArray,
int destinationIndex,
int length)
1314 Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length, reliable:
false);
1319 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
1320 internal static extern void Copy(
Array sourceArray,
int sourceIndex,
Array destinationArray,
int destinationIndex,
int length,
bool reliable);
1342 [SecuritySafeCritical]
1343 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
1344 [__DynamicallyInvokable]
1347 Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length, reliable:
true);
1367 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
1370 if (length >
int.MaxValue || length <
int.MinValue)
1374 Copy(sourceArray, destinationArray, (
int)length);
1398 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
1399 public static void Copy(
Array sourceArray,
long sourceIndex,
Array destinationArray,
long destinationIndex,
long length)
1401 if (sourceIndex >
int.MaxValue || sourceIndex <
int.MinValue)
1405 if (destinationIndex >
int.MaxValue || destinationIndex <
int.MinValue)
1409 if (length >
int.MaxValue || length <
int.MinValue)
1413 Copy(sourceArray, (
int)sourceIndex, destinationArray, (
int)destinationIndex, (
int)length);
1426 [SecuritySafeCritical]
1427 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
1428 [__DynamicallyInvokable]
1429 public static extern void Clear(
Array array,
int index,
int length);
1438 [SecuritySafeCritical]
1439 [__DynamicallyInvokable]
1442 if (indices ==
null)
1446 if (
Rank != indices.Length)
1451 fixed (
int* pIndices = indices)
1453 InternalGetReference(&typedReference, indices.Length, pIndices);
1464 [SecuritySafeCritical]
1465 [__DynamicallyInvokable]
1473 InternalGetReference(&typedReference, 1, &index);
1483 [SecuritySafeCritical]
1490 int* ptr = stackalloc
int[2];
1494 InternalGetReference(&typedReference, 2, ptr);
1506 [SecuritySafeCritical]
1507 public unsafe
object GetValue(
int index1,
int index2,
int index3)
1513 int* ptr = stackalloc
int[3];
1518 InternalGetReference(&typedReference, 3, ptr);
1531 if (index >
int.MaxValue || index <
int.MinValue)
1547 if (index1 >
int.MaxValue || index1 <
int.MinValue)
1551 if (index2 >
int.MaxValue || index2 <
int.MinValue)
1555 return GetValue((
int)index1, (
int)index2);
1567 public object GetValue(
long index1,
long index2,
long index3)
1569 if (index1 >
int.MaxValue || index1 <
int.MinValue)
1573 if (index2 >
int.MaxValue || index2 <
int.MinValue)
1577 if (index3 >
int.MaxValue || index3 <
int.MinValue)
1581 return GetValue((
int)index1, (
int)index2, (
int)index3);
1594 if (indices ==
null)
1598 if (
Rank != indices.Length)
1602 int[] array =
new int[indices.Length];
1603 for (
int i = 0; i < indices.Length; i++)
1605 long num = indices[i];
1606 if (num >
int.MaxValue || num <
int.MinValue)
1610 array[i] = (int)num;
1623 [SecuritySafeCritical]
1624 [__DynamicallyInvokable]
1632 InternalGetReference(&typedReference, 1, &index);
1633 InternalSetValue(&typedReference, value);
1644 [SecuritySafeCritical]
1645 public unsafe
void SetValue(
object value,
int index1,
int index2)
1651 int* ptr = stackalloc
int[2];
1655 InternalGetReference(&typedReference, 2, ptr);
1656 InternalSetValue(&typedReference, value);
1669 [SecuritySafeCritical]
1670 public unsafe
void SetValue(
object value,
int index1,
int index2,
int index3)
1676 int* ptr = stackalloc
int[3];
1681 InternalGetReference(&typedReference, 3, ptr);
1682 InternalSetValue(&typedReference, value);
1694 [SecuritySafeCritical]
1695 [__DynamicallyInvokable]
1696 public unsafe
void SetValue(
object value, params
int[] indices)
1698 if (indices ==
null)
1702 if (
Rank != indices.Length)
1707 fixed (
int* pIndices = indices)
1709 InternalGetReference(&typedReference, indices.Length, pIndices);
1711 InternalSetValue(&typedReference, value);
1725 if (index >
int.MaxValue || index <
int.MinValue)
1741 public void SetValue(
object value,
long index1,
long index2)
1743 if (index1 >
int.MaxValue || index1 <
int.MinValue)
1747 if (index2 >
int.MaxValue || index2 <
int.MinValue)
1751 SetValue(value, (
int)index1, (
int)index2);
1765 public void SetValue(
object value,
long index1,
long index2,
long index3)
1767 if (index1 >
int.MaxValue || index1 <
int.MinValue)
1771 if (index2 >
int.MaxValue || index2 <
int.MinValue)
1775 if (index3 >
int.MaxValue || index3 <
int.MinValue)
1779 SetValue(value, (
int)index1, (
int)index2, (
int)index3);
1792 public void SetValue(
object value, params
long[] indices)
1794 if (indices ==
null)
1798 if (
Rank != indices.Length)
1802 int[] array =
new int[indices.Length];
1803 for (
int i = 0; i < indices.Length; i++)
1805 long num = indices[i];
1806 if (num >
int.MaxValue || num <
int.MinValue)
1810 array[i] = (int)num;
1817 private unsafe
extern void InternalGetReference(
void* elemRef,
int rank,
int* pIndices);
1821 private unsafe
static extern void InternalSetValue(
void* target,
object value);
1823 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
1824 private static int GetMedian(
int low,
int hi)
1826 return low + (hi - low >> 1);
1836 [SecuritySafeCritical]
1837 [__DynamicallyInvokable]
1838 public extern int GetLength(
int dimension);
1859 [SecuritySafeCritical]
1860 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
1861 [__DynamicallyInvokable]
1871 [SecuritySafeCritical]
1872 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
1873 [__DynamicallyInvokable]
1878 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
1879 internal extern int GetDataPtrOffsetInternal();
1885 [__DynamicallyInvokable]
1895 [__DynamicallyInvokable]
1903 [__DynamicallyInvokable]
1912 [__DynamicallyInvokable]
1915 return IndexOf(
this, value);
1926 [__DynamicallyInvokable]
1929 throw new NotSupportedException(Environment.GetResourceString(
"NotSupported_FixedSizeCollection"));
1935 [__DynamicallyInvokable]
1938 throw new NotSupportedException(Environment.GetResourceString(
"NotSupported_FixedSizeCollection"));
1945 [__DynamicallyInvokable]
1948 throw new NotSupportedException(Environment.GetResourceString(
"NotSupported_FixedSizeCollection"));
1953 [__DynamicallyInvokable]
1956 return MemberwiseClone();
1963 [__DynamicallyInvokable]
1970 Array array = other as Array;
1971 if (array ==
null ||
Length != array.Length)
1973 throw new ArgumentException(Environment.GetResourceString(
"ArgumentException_OtherNotArrayOfCorrectLength"),
"other");
1977 for (; i < array.Length; i++)
1984 object value2 = array.GetValue(i);
1985 num = comparer.
Compare(value, value2);
1995 [__DynamicallyInvokable]
2006 Array array = other as Array;
2007 if (array ==
null || array.Length !=
Length)
2011 for (
int i = 0; i < array.Length; i++)
2014 object value2 = array.GetValue(i);
2015 if (!comparer.
Equals(value, value2))
2023 internal static int CombineHashCodes(
int h1,
int h2)
2025 return ((h1 << 5) + h1) ^ h2;
2031 [__DynamicallyInvokable]
2034 if (comparer ==
null)
2036 throw new ArgumentNullException(
"comparer");
2058 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2059 [__DynamicallyInvokable]
2066 int lowerBound = array.GetLowerBound(0);
2067 return BinarySearch(array, lowerBound, array.Length, value,
null);
2088 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2089 [__DynamicallyInvokable]
2092 return BinarySearch(array, index, length, value,
null);
2109 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2110 [__DynamicallyInvokable]
2117 int lowerBound = array.GetLowerBound(0);
2118 return BinarySearch(array, lowerBound, array.Length, value, comparer);
2141 [SecuritySafeCritical]
2142 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2143 [__DynamicallyInvokable]
2150 int lowerBound = array.GetLowerBound(0);
2151 if (index < lowerBound || length < 0)
2155 if (array.Length - (index - lowerBound) < length)
2159 if (array.Rank != 1)
2163 if (comparer ==
null)
2167 if (comparer ==
Comparer.
Default && TrySZBinarySearch(array, index, length, value, out
int retVal))
2172 int num2 = index + length - 1;
2173 object[] array2 = array as
object[];
2178 int median = GetMedian(num, num2);
2182 num3 = comparer.
Compare(array2[median], value);
2206 int median2 = GetMedian(num, num2);
2210 num4 = comparer.
Compare(array.GetValue(median2), value);
2235 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2236 private static extern bool TrySZBinarySearch(
Array sourceArray,
int sourceIndex,
int count,
object value, out
int retVal);
2247 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2248 [__DynamicallyInvokable]
2255 return BinarySearch(array, 0, array.Length, value,
null);
2271 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2272 [__DynamicallyInvokable]
2279 return BinarySearch(array, 0, array.Length, value, comparer);
2299 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2300 [__DynamicallyInvokable]
2303 return BinarySearch(array, index, length, value,
null);
2325 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2326 [__DynamicallyInvokable]
2333 if (index < 0 || length < 0)
2337 if (array.Length - index < length)
2341 return ArraySortHelper<T>.Default.BinarySearch(array, index, length, value, comparer);
2359 if (converter ==
null)
2363 TOutput[] array2 =
new TOutput[array.Length];
2364 for (
int i = 0; i < array.Length; i++)
2366 array2[i] = converter(array[i]);
2383 [__DynamicallyInvokable]
2386 if (array !=
null && array.Rank != 1)
2408 if (index >
int.MaxValue || index <
int.MinValue)
2412 CopyTo(array, (
int)index);
2418 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2419 [__DynamicallyInvokable]
2422 return EmptyArray<T>.Value;
2434 [__DynamicallyInvokable]
2437 return FindIndex(array, match) != -1;
2448 [__DynamicallyInvokable]
2459 for (
int i = 0; i < array.Length; i++)
2461 if (match(array[i]))
2477 [__DynamicallyInvokable]
2489 for (
int i = 0; i < array.Length; i++)
2491 if (match(array[i]))
2496 return list.ToArray();
2507 [__DynamicallyInvokable]
2514 return FindIndex(array, 0, array.Length, match);
2528 [__DynamicallyInvokable]
2535 return FindIndex(array, startIndex, array.Length - startIndex, match);
2552 [__DynamicallyInvokable]
2553 public static int FindIndex<T>(
T[] array,
int startIndex,
int count, Predicate<T> match)
2559 if (startIndex < 0 || startIndex > array.Length)
2563 if (count < 0 || startIndex > array.Length - count)
2571 int num = startIndex + count;
2572 for (
int i = startIndex; i < num; i++)
2574 if (match(array[i]))
2590 [__DynamicallyInvokable]
2601 for (
int num = array.Length - 1; num >= 0; num--)
2603 if (match(array[num]))
2619 [__DynamicallyInvokable]
2626 return FindLastIndex(array, array.Length - 1, array.Length, match);
2640 [__DynamicallyInvokable]
2647 return FindLastIndex(array, startIndex, startIndex + 1, match);
2664 [__DynamicallyInvokable]
2675 if (array.Length == 0)
2677 if (startIndex != -1)
2682 else if (startIndex < 0 || startIndex >= array.Length)
2686 if (count < 0 || startIndex - count + 1 < 0)
2690 int num = startIndex - count;
2691 for (
int num2 = startIndex; num2 > num; num2--)
2693 if (match(array[num2]))
2718 for (
int i = 0; i < array.Length; i++)
2726 [__DynamicallyInvokable]
2730 if (
Rank == 1 && lowerBound == 0)
2732 return new SZArrayEnumerator(
this);
2734 return new ArrayEnumerator(
this, lowerBound,
Length);
2745 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2746 [__DynamicallyInvokable]
2753 int lowerBound = array.GetLowerBound(0);
2754 return IndexOf(array, value, lowerBound, array.Length);
2768 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2769 [__DynamicallyInvokable]
2776 int lowerBound = array.GetLowerBound(0);
2777 return IndexOf(array, value, startIndex, array.Length - startIndex + lowerBound);
2794 [SecuritySafeCritical]
2795 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2796 [__DynamicallyInvokable]
2797 public static int IndexOf(
Array array,
object value,
int startIndex,
int count)
2803 if (array.Rank != 1)
2807 int lowerBound = array.GetLowerBound(0);
2808 if (startIndex < lowerBound || startIndex > array.Length + lowerBound)
2812 if (count < 0 || count > array.Length - startIndex + lowerBound)
2816 if (TrySZIndexOf(array, startIndex, count, value, out
int retVal))
2820 object[] array2 = array as
object[];
2821 int num = startIndex + count;
2826 for (
int i = startIndex; i < num; i++)
2828 if (array2[i] ==
null)
2836 for (
int j = startIndex; j < num; j++)
2838 object obj = array2[j];
2839 if (obj !=
null && obj.Equals(value))
2848 for (
int k = startIndex; k < num; k++)
2850 object value2 = array.GetValue(k);
2858 else if (value2.Equals(value))
2864 return lowerBound - 1;
2874 [__DynamicallyInvokable]
2881 return IndexOf(array, value, 0, array.Length);
2894 [__DynamicallyInvokable]
2901 return IndexOf(array, value, startIndex, array.Length - startIndex);
2917 [__DynamicallyInvokable]
2918 public static int IndexOf<T>(
T[] array,
T value,
int startIndex,
int count)
2924 if (startIndex < 0 || startIndex > array.Length)
2928 if (count < 0 || count > array.Length - startIndex)
2937 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2938 private static extern bool TrySZIndexOf(
Array sourceArray,
int sourceIndex,
int count,
object value, out
int retVal);
2948 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2949 [__DynamicallyInvokable]
2956 int lowerBound = array.GetLowerBound(0);
2957 return LastIndexOf(array, value, array.Length - 1 + lowerBound, array.Length);
2971 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2972 [__DynamicallyInvokable]
2979 int lowerBound = array.GetLowerBound(0);
2980 return LastIndexOf(array, value, startIndex, startIndex + 1 - lowerBound);
2997 [SecuritySafeCritical]
2998 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
2999 [__DynamicallyInvokable]
3006 int lowerBound = array.GetLowerBound(0);
3007 if (array.Length == 0)
3009 return lowerBound - 1;
3011 if (startIndex < lowerBound || startIndex >= array.Length + lowerBound)
3019 if (count > startIndex - lowerBound + 1)
3023 if (array.Rank != 1)
3027 if (TrySZLastIndexOf(array, startIndex, count, value, out
int retVal))
3031 object[] array2 = array as
object[];
3032 int num = startIndex - count + 1;
3037 for (
int num2 = startIndex; num2 >= num; num2--)
3039 if (array2[num2] ==
null)
3047 for (
int num3 = startIndex; num3 >= num; num3--)
3049 object obj = array2[num3];
3050 if (obj !=
null && obj.Equals(value))
3059 for (
int num4 = startIndex; num4 >= num; num4--)
3061 object value2 = array.GetValue(num4);
3069 else if (value2.Equals(value))
3075 return lowerBound - 1;
3085 [__DynamicallyInvokable]
3092 return LastIndexOf(array, value, array.Length - 1, array.Length);
3105 [__DynamicallyInvokable]
3112 return LastIndexOf(array, value, startIndex, (array.Length != 0) ? (startIndex + 1) : 0);
3128 [__DynamicallyInvokable]
3135 if (array.Length == 0)
3137 if (startIndex != -1 && startIndex != 0)
3147 if (startIndex < 0 || startIndex >= array.Length)
3151 if (count < 0 || startIndex - count + 1 < 0)
3160 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.MayFail)]
3161 private static extern bool TrySZLastIndexOf(
Array sourceArray,
int sourceIndex,
int count,
object value, out
int retVal);
3169 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3170 [__DynamicallyInvokable]
3177 Reverse(array, array.GetLowerBound(0), array.Length);
3193 [SecuritySafeCritical]
3194 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3195 [__DynamicallyInvokable]
3202 if (index < array.GetLowerBound(0) || length < 0)
3206 if (array.Length - (index - array.GetLowerBound(0)) < length)
3210 if (array.Rank != 1)
3214 if (TrySZReverse(array, index, length))
3219 int num2 = index + length - 1;
3220 object[] array2 = array as
object[];
3225 object obj = array2[num];
3226 array2[num] = array2[num2];
3236 object value = array.GetValue(num);
3237 array.SetValue(array.GetValue(num2), num);
3238 array.SetValue(value, num2);
3247 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3248 private static extern bool TrySZReverse(
Array array,
int index,
int count);
3257 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3258 [__DynamicallyInvokable]
3265 Sort(array,
null, array.GetLowerBound(0), array.Length,
null);
3278 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3279 [__DynamicallyInvokable]
3303 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3304 [__DynamicallyInvokable]
3307 Sort(array,
null, index, length,
null);
3327 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3328 [__DynamicallyInvokable]
3331 Sort(keys, items, index, length,
null);
3345 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3346 [__DynamicallyInvokable]
3353 Sort(array,
null, array.GetLowerBound(0), array.Length, comparer);
3370 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3371 [__DynamicallyInvokable]
3399 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3400 [__DynamicallyInvokable]
3403 Sort(array,
null, index, length, comparer);
3428 [SecuritySafeCritical]
3429 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3430 [__DynamicallyInvokable]
3437 if (keys.
Rank != 1 || (items !=
null && items.
Rank != 1))
3453 if (length > 1 && ((comparer !=
Comparer.
Default && comparer !=
null) || !TrySZSort(keys, items, index, index + length - 1)))
3455 object[] array = keys as
object[];
3456 object[] array2 =
null;
3459 array2 = (items as
object[]);
3461 if (array !=
null && (items ==
null || array2 !=
null))
3463 new SorterObjectArray(array, array2, comparer).
Sort(index, length);
3467 new SorterGenericArray(keys, items, comparer).Sort(index, length);
3474 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3475 private static extern bool TrySZSort(
Array keys,
Array items,
int left,
int right);
3483 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3484 [__DynamicallyInvokable]
3491 Sort(array, array.GetLowerBound(0), array.Length,
null);
3505 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3506 [__DynamicallyInvokable]
3513 Sort(keys, items, 0, keys.Length,
null);
3529 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3530 [__DynamicallyInvokable]
3531 public static void Sort<T>(
T[] array,
int index,
int length)
3533 Sort(array, index, length,
null);
3554 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3555 [__DynamicallyInvokable]
3558 Sort(keys, items, index, length,
null);
3570 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3571 [__DynamicallyInvokable]
3578 Sort(array, 0, array.Length, comparer);
3595 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3596 [__DynamicallyInvokable]
3603 Sort(keys, items, 0, keys.Length, comparer);
3622 [SecuritySafeCritical]
3623 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3624 [__DynamicallyInvokable]
3631 if (index < 0 || length < 0)
3635 if (array.Length - index < length)
3639 if (length > 1 && ((comparer !=
null && comparer !=
Comparer<T>.
Default) || !TrySZSort(array,
null, index, index + length - 1)))
3641 ArraySortHelper<T>.Default.Sort(array, index, length, comparer);
3666 [SecuritySafeCritical]
3667 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
3668 [__DynamicallyInvokable]
3675 if (index < 0 || length < 0)
3679 if (keys.Length - index < length || (items !=
null && index > items.Length - length))
3683 if (length > 1 && ((comparer !=
null && comparer !=
Comparer<TKey>.
Default) || !TrySZSort(keys, items, index, index + length - 1)))
3687 Sort(keys, index, length, comparer);
3691 ArraySortHelper<TKey, TValue>.Default.Sort(keys, items, index, length, comparer);
3704 [__DynamicallyInvokable]
3705 public static void Sort<T>(
T[] array, Comparison<T> comparison)
3711 if (comparison ==
null)
3715 IComparer<T> comparer =
new FunctorComparer<T>(comparison);
3716 Sort(array, comparer);
3728 [__DynamicallyInvokable]
3739 for (
int i = 0; i < array.Length; i++)
3741 if (!match(array[i]))
3751 [SecuritySafeCritical]
3752 [__DynamicallyInvokable]
static int LastIndexOf(Array array, object value, int startIndex)
Searches for the specified object and returns the index of the last occurrence within the range of el...
bool Equals(object other, IEqualityComparer comparer)
Determines whether an object is structurally equal to the current instance.
static bool TrueForAll< T >(T[] array, Predicate< T > match)
Determines whether every element in the array matches the conditions defined by the specified predica...
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...
Provides a base class for implementations of the T:System.Collections.Generic.IEqualityComparer`1 gen...
unsafe void SetValue(object value, int index1, int index2, int index3)
Sets a value to the element at the specified position in the three-dimensional T:System....
bool IsReadOnly
Gets a value indicating whether the T:System.Array is read-only.
static void Reverse(Array array, int index, int length)
Reverses the sequence of the elements in a range of elements in the one-dimensional T:System....
static void Resize< T >(ref T[] array, int newSize)
Changes the number of elements of a one-dimensional array to the specified new size.
Provides the base class for a generic read-only collection.
static T Find< T >(T[] array, Predicate< T > match)
Searches for an element that matches the conditions defined by the specified predicate,...
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.
static void Sort(Array array, int index, int length)
Sorts the elements in a range of elements in a one-dimensional T:System.Array using the T:System....
static void Copy(Array sourceArray, Array destinationArray, long length)
Copies a range of elements from an T:System.Array starting at the first element and pastes them into ...
static void Copy(Array sourceArray, long sourceIndex, Array destinationArray, long destinationIndex, long length)
Copies a range of elements from an T:System.Array starting at the specified source index and pastes t...
void CopyTo(Array array, int index)
Copies all the elements of the current one-dimensional array to the specified one-dimensional array s...
Represents a non-generic collection of objects that can be individually accessed by index.
void RemoveAt(int index)
Removes the T:System.Collections.IList item at the specified index.
static void Sort(Array array, IComparer comparer)
Sorts the elements in a one-dimensional T:System.Array using the specified T:System....
static int IndexOf< T >(T[] array, T value)
Searches for the specified object and returns the index of its first occurrence in a one-dimensional ...
void Insert(int index, object value)
Inserts an item to the T:System.Collections.IList at the specified index.
static int BinarySearch(Array array, int index, int length, object value)
Searches a range of elements in a one-dimensional sorted array for a value, using the T:System....
static void Reverse(Array array)
Reverses the sequence of the elements in the entire one-dimensional T:System.Array.
The exception that is thrown when the value of an argument is outside the allowable range of values a...
void SetValue(object value, long index1, long index2, long index3)
Sets a value to the element at the specified position in the three-dimensional T:System....
abstract Type UnderlyingSystemType
Indicates the type provided by the common language runtime that represents this type.
void SetValue(object value, long index1, long index2)
Sets a value to the element at the specified position in the two-dimensional T:System....
static T FindLast< T >(T[] array, Predicate< T > match)
Searches for an element that matches the conditions defined by the specified predicate,...
static void Sort(Array keys, Array items, int index, int length)
Sorts a range of elements in a pair of one-dimensional T:System.Array objects (one contains the keys ...
object SyncRoot
Gets an object that can be used to synchronize access to the T:System.Array.
long GetLongLength(int dimension)
Gets a 64-bit integer that represents the number of elements in the specified dimension of the T:Syst...
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.
void Initialize()
Initializes every element of the value-type T:System.Array by calling the default constructor of the ...
static EqualityComparer< T > Default
Returns a default equality comparer for the type specified by the generic argument.
static void Sort< T >(T[] array)
Sorts the elements in an entire T:System.Array using the T:System.IComparable`1 generic interface imp...
int Rank
Gets the rank (number of dimensions) of the T:System.Array. For example, a one-dimensional array retu...
int GetHashCode(IEqualityComparer comparer)
Returns a hash code for the current instance.
Cer
Specifies a method's behavior when called within a constrained execution region.
static unsafe Array CreateInstance(Type elementType, int length1, int length2)
Creates a two-dimensional T:System.Array of the specified T:System.Type and dimension lengths,...
unsafe object GetValue(int index1, int index2)
Gets the value at the specified position in the two-dimensional T:System.Array. The indexes are speci...
static void ConstrainedCopy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length)
Copies a range of elements from an T:System.Array starting at the specified source index and pastes t...
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....
new bool Equals(object x, object y)
Determines whether the specified objects are equal.
static Array CreateInstance(Type elementType, params long[] lengths)
Creates a multidimensional T:System.Array of the specified T:System.Type and dimension lengths,...
Describes objects that contain both a managed pointer to a location and a runtime representation of t...
static int LastIndexOf(Array array, object value, int startIndex, int count)
Searches for the specified object and returns the index of the last occurrence within the range of el...
static void Sort(Array array)
Sorts the elements in an entire one-dimensional T:System.Array using the T:System....
static int BinarySearch< T >(T[] array, T value)
Searches an entire one-dimensional sorted array for a specific element, using the T:System....
Represents a collection that can contain many different types of permissions.
object GetValue(long index1, long index2, long index3)
Gets the value at the specified position in the three-dimensional T:System.Array. The indexes are spe...
static ReadOnlyCollection< T > AsReadOnly< T >(T[] array)
Returns a read-only wrapper for the specified array.
The exception that is thrown when an attempt is made to access an element of an array or collection w...
int GetLowerBound(int dimension)
Gets the index of the first element of the specified dimension in the array.
void CopyTo(Array array, long index)
Copies all the elements of the current one-dimensional array to the specified one-dimensional array s...
unsafe void SetValue(object value, int index)
Sets a value to the element at the specified position in the one-dimensional T:System....
static int FindIndex< T >(T[] array, Predicate< T > match)
Searches for an element that matches the conditions defined by the specified predicate,...
Defines methods to support the comparison of objects for equality.
static readonly Comparer Default
Represents an instance of T:System.Collections.Comparer that is associated with the P:System....
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...
static void ForEach< T >(T[] array, Action< T > action)
Performs the specified action on each element of the specified array.
void SetValue(object value, params long[] indices)
Sets a value to the element at the specified position in the multidimensional T:System....
Represents type declarations: class types, interface types, array types, value types,...
unsafe object GetValue(params int[] indices)
Gets the value at the specified position in the multidimensional T:System.Array. The indexes are spec...
static int BinarySearch(Array array, int index, int length, object value, IComparer comparer)
Searches a range of elements in a one-dimensional sorted array for a value, using the specified T:Sys...
int Add(object value)
Adds an item to the T:System.Collections.IList.
bool IsFixedSize
Gets a value indicating whether the T:System.Array has a fixed size.
MethodImplOptions
Defines the details of how a method is implemented.
static void Sort(Array array, int index, int length, IComparer comparer)
Sorts the elements in a range of elements in a one-dimensional T:System.Array using the specified T:S...
static int BinarySearch(Array array, object value)
Searches an entire one-dimensional sorted array for a specific element, using the T:System....
static bool Exists< T >(T[] array, Predicate< T > match)
Determines whether the specified array contains elements that match the conditions defined by the spe...
object Clone()
Creates a shallow copy of the T:System.Array.
int GetUpperBound(int dimension)
Gets the index of the last element of the specified dimension in the array.
static unsafe Array CreateInstance(Type elementType, int[] lengths, int[] lowerBounds)
Creates a multidimensional T:System.Array of the specified T:System.Type and dimension lengths,...
int GetHashCode(object obj)
Returns a hash code for the specified object.
The exception that is thrown when one of the arguments provided to a method is not valid.
unsafe void SetValue(object value, int index1, int index2)
Sets a value to the element at the specified position in the two-dimensional T:System....
static void Sort(Array keys, Array items)
Sorts a pair of one-dimensional T:System.Array objects (one contains the keys and the other contains ...
object GetValue(params long[] indices)
Gets the value at the specified position in the multidimensional T:System.Array. The indexes are spec...
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 ...
static int IndexOf(Array array, object value, int startIndex)
Searches for the specified object in a range of elements of a one-dimensional array,...
static int FindLastIndex< T >(T[] array, Predicate< T > match)
Searches for an element that matches the conditions defined by the specified predicate,...
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
static int LastIndexOf< T >(T[] array, T value)
Searches for the specified object and returns the index of the last occurrence within the entire T:Sy...
static int IndexOf(Array array, object value)
Searches for the specified object and returns the index of its first occurrence in a one-dimensional ...
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
static int IndexOf(Array array, object value, int startIndex, int count)
Searches for the specified object in a range of elements of a one-dimensional array,...
static unsafe Array CreateInstance(Type elementType, params int[] lengths)
Creates a multidimensional T:System.Array of the specified T:System.Type and dimension lengths,...
object GetValue(long index1, long index2)
Gets the value at the specified position in the two-dimensional T:System.Array. The indexes are speci...
int CompareTo(object other, IComparer comparer)
Determines whether the current collection object precedes, occurs in the same position as,...
IEnumerator GetEnumerator()
Returns an T:System.Collections.IEnumerator for the T:System.Array.
int Length
Gets the total number of elements in all the dimensions of the T:System.Array.
object GetValue(long index)
Gets the value at the specified position in the one-dimensional T:System.Array. The index is specifie...
Specifies that the class can be serialized.
static void Copy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length)
Copies a range of elements from an T:System.Array starting at the specified source index and pastes t...
static void Sort< TKey, TValue >(TKey[] keys, TValue[] items)
Sorts a pair of T:System.Array objects (one contains the keys and the other contains the correspondin...
static int BinarySearch(Array array, object value, IComparer comparer)
Searches an entire one-dimensional sorted array for a value using the specified T:System....
The exception that is thrown when a method call is invalid for the object's current state.
unsafe void SetValue(object value, params int[] indices)
Sets a value to the element at the specified position in the multidimensional T:System....
void Remove(object value)
Removes the first occurrence of a specific object from the T:System.Collections.IList.
static T [] Empty< T >()
Returns an empty array.
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.
Consistency
Specifies a reliability contract.
unsafe object GetValue(int index1, int index2, int index3)
Gets the value at the specified position in the three-dimensional T:System.Array. The indexes are spe...
int GetLength(int dimension)
Gets a 32-bit integer that represents the number of elements in the specified dimension of the T:Syst...
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 ...
void SetValue(object value, long index)
Sets a value to the element at the specified position in the one-dimensional T:System....
Defines size, enumerators, and synchronization methods for all nongeneric collections.
static T [] FindAll< T >(T[] array, Predicate< T > match)
Retrieves all the elements that match the conditions defined by the specified predicate.
long LongLength
Gets a 64-bit integer that represents the total number of elements in all the dimensions of the T:Sys...
The exception that is thrown when an array with the wrong number of dimensions is passed to a method.
static void Sort(Array keys, Array items, int index, int length, IComparer comparer)
Sorts a range of elements in a pair of one-dimensional T:System.Array objects (one contains the keys ...
The default setting for this enumeration, which is currently F:System.GCCollectionMode....
Defines methods to support the comparison of objects for structural equality.
Supports a simple iteration over a non-generic collection.
Supports the structural comparison of collection objects.
static unsafe Array CreateInstance(Type elementType, int length1, int length2, int length3)
Creates a three-dimensional T:System.Array of the specified T:System.Type and dimension lengths,...
unsafe object GetValue(int index)
Gets the value at the specified position in the one-dimensional T:System.Array. The index is specifie...
static unsafe Array CreateInstance(Type elementType, int length)
Creates a one-dimensional T:System.Array of the specified T:System.Type and length,...
static TOutput [] ConvertAll< TInput, TOutput >(TInput[] array, Converter< TInput, TOutput > converter)
Converts an array of one type to an array of another type.
bool IsSynchronized
Gets a value indicating whether access to the T:System.Array is synchronized (thread safe).
static void Sort(Array keys, Array items, IComparer comparer)
Sorts a pair of one-dimensional T:System.Array objects (one contains the keys and the other contains ...