Created
January 7, 2012 03:51
-
-
Save jonpryor/1573719 to your computer and use it in GitHub Desktop.
System.Array.Sort() docs extracted from: http://www.ecma-international.org/publications/standards/Ecma-335.htm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Member MemberName="Sort"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort(class System.Array keys, class System.Array items, int32 index, int32 length, class System.Collections.IComparer comparer)" /> | |
<MemberSignature Language="C#" Value="public static void Sort(Array keys, Array items, int index, int length, IComparer comparer);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="keys" Type="System.Array" /> | |
<Parameter Name="items" Type="System.Array" /> | |
<Parameter Name="index" Type="System.Int32" /> | |
<Parameter Name="length" Type="System.Int32" /> | |
<Parameter Name="comparer" Type="System.Collections.IComparer" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts the specified range of the specified pair of one-dimensional <see cref="T:System.Array" /> objects (one | |
containing a set of keys and the other containing corresponding items) based on | |
the keys in the first specified <see cref="T:System.Array" /> using the specified <see cref="T:System.Collections.IComparer" /> | |
implementation.</para> | |
</summary> | |
<param name="keys">A one-dimensional <see cref="T:System.Array" /> that contains the keys to sort.</param> | |
<param name="items"> | |
<para>A one-dimensional <see cref="T:System.Array" /> that contains the items that correspond to each element of <paramref name="keys" />. Specify a null reference to sort only <paramref name="keys" />.</para> | |
</param> | |
<param name="index">A <see cref="T:System.Int32" /> that contains the index at which sorting starts.</param> | |
<param name="length">A <see cref="T:System.Int32" /> that contains the number of elements to sort.</param> | |
<param name="comparer"> | |
<para>The <see cref="T:System.Collections.IComparer" /> implementation to use when comparing elements. Specify a null reference to use the <see cref="T:System.IComparable" /> implementation of each element.</para> | |
</param> | |
<exception cref="T:System.ArgumentNullException"> | |
<para> | |
<paramref name="keys" /> is <see langword="null" />.</para> | |
</exception> | |
<exception cref="T:System.RankException"> | |
<para> | |
<paramref name="keys" /> has more than one dimension.</para> | |
<para>-or-</para> | |
<para> | |
<paramref name="items" /> is not a null reference and has more than one dimension.</para> | |
</exception> | |
<exception cref="T:System.ArgumentOutOfRangeException"> | |
<para> | |
<paramref name="index" /> < <paramref name="keys" />.GetLowerBound(0).</para> | |
<para>-or-</para> | |
<para> | |
<paramref name="length" /> < 0.</para> | |
</exception> | |
<exception cref="T:System.ArgumentException"> | |
<para> | |
<paramref name="items" /> is not a null reference, and <paramref name="keys" />.GetLowerBound(0) does not equal <paramref name="items" />.GetLowerBound(0). </para> | |
<para>-or- </para> | |
<para> | |
<paramref name="index" /> and <paramref name="length" /> do not specify a valid range in <paramref name="key" />. </para> | |
<para>-or- </para> | |
<para> | |
<paramref name="items" /> is not a null reference, and <paramref name="index" /> and <paramref name="length" /> do not specify a valid range in <paramref name="items" />. </para> | |
</exception> | |
<exception cref="T:System.InvalidOperationException"> | |
<para> | |
<paramref name="comparer" /> is <see langword="null" />, and one or more elements in <paramref name="keys" /> that are used in a comparison do not implement the <see cref="T:System.IComparable" /> interface. </para> | |
</exception> | |
<remarks> | |
<para> Each key in <paramref name="keys" /> is required to have | |
a corresponding item in <paramref name="items" />. The sort is performed according to the | |
order of <paramref name="keys" />. After a key is repositioned during the sort, | |
the corresponding item in <paramref name="items" /> is similarly repositioned. Only | |
<paramref name="keys" />.Length elements of <paramref name="items" /> will be sorted. Therefore, | |
<paramref name="items" /> is sorted according to the arrangement of | |
the corresponding keys in <paramref name="keys" />. If the sort is not successfully | |
completed, the results are undefined.</para> | |
<para>If <paramref name="comparer" /> is a null reference, each element | |
of <paramref name="keys" /> is required to implement the <see cref="T:System.IComparable" /> interface to be capable of comparisons | |
with every other element in <paramref name="keys" />.</para> | |
</remarks> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> | |
<Member MemberName="Sort"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort(class System.Array array, int32 index, int32 length, class System.Collections.IComparer comparer)" /> | |
<MemberSignature Language="C#" Value="public static void Sort(Array array, int index, int length, IComparer comparer);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="array" Type="System.Array" /> | |
<Parameter Name="index" Type="System.Int32" /> | |
<Parameter Name="length" Type="System.Int32" /> | |
<Parameter Name="comparer" Type="System.Collections.IComparer" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts the elements in the specified section of the | |
specified one-dimensional <see cref="T:System.Array" /> | |
using the specified <see cref="T:System.Collections.IComparer" /> | |
implementation.</para> | |
</summary> | |
<param name="array">A one-dimensional <see cref="T:System.Array" /> to sort.</param> | |
<param name="index">A <see cref="T:System.Int32" /> that contains the index at which sorting starts.</param> | |
<param name="length">A <see cref="T:System.Int32" /> that contains the number of elements to sort.</param> | |
<param name="comparer"> | |
<para>The <see cref="T:System.Collections.IComparer" /> implementation to use when comparing elements. Specify a null reference to use the <see cref="T:System.IComparable" /> implementation of each element.</para> | |
</param> | |
<exception cref="T:System.ArgumentNullException"> | |
<paramref name="array" /> is <see langword="null" />. </exception> | |
<exception cref="T:System.RankException"> | |
<paramref name="array" /> has more than one dimension. </exception> | |
<exception cref="T:System.ArgumentOutOfRangeException"> | |
<para> | |
<paramref name="index" /> < <paramref name="array" />.GetLowerBound(0).</para> | |
<para>-or-</para> | |
<para> | |
<paramref name="length" /> < 0.</para> | |
</exception> | |
<exception cref="T:System.ArgumentException"> | |
<para> | |
<paramref name="index" /> and <paramref name="length" /> do not specify a valid range in <paramref name="array" />.</para> | |
</exception> | |
<exception cref="T:System.InvalidOperationException"> | |
<para> | |
<paramref name="comparer" /> is <see langword="null" />, and one or more elements in <paramref name="array" /> that are used in a comparison do not implement the <see cref="T:System.IComparable" /> interface. </para> | |
</exception> | |
<remarks> | |
<para>This version of <see cref="M:System.Array.Sort(System.Array)" /> is equivalent to <see cref="M:System.Array.Sort(System.Array)" />(<paramref name="array" />, <see langword="null" />, <paramref name="index" />, <paramref name="length" />, <paramref name="comparer" />).</para> | |
<para>If <paramref name="comparer" /> is a null reference, each element | |
of <paramref name="array" /> is required to implement the <see cref="T:System.IComparable" /> interface to be capable of comparisons | |
with every other element in <paramref name="array" />. If the sort is not successfully | |
completed, the results are unspecified.</para> | |
</remarks> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> | |
<Member MemberName="Sort"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort(class System.Array keys, class System.Array items, class System.Collections.IComparer comparer)" /> | |
<MemberSignature Language="C#" Value="public static void Sort(Array keys, Array items, IComparer comparer);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="keys" Type="System.Array" /> | |
<Parameter Name="items" Type="System.Array" /> | |
<Parameter Name="comparer" Type="System.Collections.IComparer" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts the specified pair of one-dimensional | |
<see cref="T:System.Array" /> objects (one | |
containing a set of keys and the other containing corresponding items) based on | |
the keys in the first specified <see cref="T:System.Array" /> using the specified <see cref="T:System.Collections.IComparer" /> implementation.</para> | |
</summary> | |
<param name="keys">A one-dimensional <see cref="T:System.Array" /> that contains the keys to sort.</param> | |
<param name="items"> | |
<para>A one-dimensional <see cref="T:System.Array" /> that contains the items that correspond to each element in <paramref name="keys" />. Specify a null reference to sort only <paramref name="keys" />.</para> | |
</param> | |
<param name="comparer"> | |
<para>The <see cref="T:System.Collections.IComparer" /> implementation to use when comparing elements. Specify a null reference to use the <see cref="T:System.IComparable" /> implementation of each element.</para> | |
</param> | |
<exception cref="T:System.ArgumentNullException"> | |
<para> | |
<paramref name="keys" /> is <see langword="null" />.</para> | |
</exception> | |
<exception cref="T:System.RankException"> | |
<para> | |
<paramref name="keys" /> has more than one dimension.</para> | |
<para>-or-</para> | |
<para> | |
<paramref name="items" /> is not a null reference and has more than one dimension.</para> | |
</exception> | |
<exception cref="T:System.ArgumentException"> | |
<para> | |
<paramref name="items" /> is not a null reference, and <paramref name="keys" />.GetLowerBound(0) does not equal <paramref name="items" />.GetLowerBound(0). </para> | |
<para>-or-</para> | |
<para> | |
<paramref name="items" /> is not a null reference, and <paramref name="keys" />.Length > <paramref name="items" />.Length.</para> | |
</exception> | |
<exception cref="T:System.InvalidOperationException"> | |
<para> | |
<paramref name="comparer" /> is a <see langword="null" />, and one or more elements in <paramref name="keys" /> that are used in a comparison do not implement the <see cref="T:System.IComparable" /> interface. </para> | |
</exception> | |
<remarks> | |
<para>This version of <see cref="M:System.Array.Sort(System.Array)" /> is equivalent to <see cref="M:System.Array.Sort(System.Array)" />(<paramref name="keys" />, <paramref name="items" />, <paramref name="keys" />.GetLowerBound(0), <paramref name="keys" />.Length, <paramref name="comparer" />).</para> | |
<para> Each key in <paramref name="keys" /> is required to have | |
a corresponding item in <paramref name="items" />. The sort is performed according to the order of | |
<paramref name="keys" /> . After a key is repositioned during the sort, the | |
corresponding item in <paramref name="items" /> is similarly repositioned. Only | |
<paramref name="keys" />.Length elements of <paramref name="items" /> are sorted. Therefore, | |
<paramref name="items" /> | |
is sorted according to the arrangement of the corresponding keys in | |
<paramref name="keys" />. If | |
the sort is not successfully completed, the results are unspecified.</para> | |
<para>If <paramref name="comparer" /> is a null reference, each element | |
of <paramref name="keys" /> is required to implement the <see cref="T:System.IComparable" /> interface to be capable of comparisons | |
with every other element in <paramref name="keys" />.</para> | |
</remarks> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> | |
<Member MemberName="Sort"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort(class System.Array array, class System.Collections.IComparer comparer)" /> | |
<MemberSignature Language="C#" Value="public static void Sort(Array array, IComparer comparer);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="array" Type="System.Array" /> | |
<Parameter Name="comparer" Type="System.Collections.IComparer" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts the elements in the specified one-dimensional <see cref="T:System.Array" /> using the | |
specified <see cref="T:System.Collections.IComparer" /> implementation.</para> | |
</summary> | |
<param name="array">The one-dimensional <see cref="T:System.Array" /> to sort.</param> | |
<param name="comparer"> | |
<para>The <see cref="T:System.Collections.IComparer" /> implementation to use when comparing elements. Specify a null reference to use the <see cref="T:System.IComparable" /> implementation of each element.</para> | |
</param> | |
<exception cref="T:System.ArgumentNullException"> | |
<paramref name="array" /> is <see langword="null" />. </exception> | |
<exception cref="T:System.RankException"> | |
<paramref name="array" /> has more than one dimension. </exception> | |
<exception cref="T:System.InvalidOperationException"> | |
<paramref name="comparer" /> is a null reference, and one or more elements in <paramref name="array" /> that are used in a comparison do not implement the <see cref="T:System.IComparable" /> interface.</exception> | |
<remarks> | |
<para>This version of <see cref="M:System.Array.Sort(System.Array)" /> is equivalent to <see cref="M:System.Array.Sort(System.Array)" />(<paramref name="array" />, <see langword="null" />, <paramref name="array" />.GetLowerBound(0), <paramref name="array" />.Length, | |
<paramref name="comparer" />).</para> | |
<para>If <paramref name="comparer" /> is a null reference, each element | |
of <paramref name="array" /> is required to implement the <see cref="T:System.IComparable" /> interface to be capable of comparisons | |
with every other element in <paramref name="array" />. If the sort is not successfully | |
completed, the results are unspecified.</para> | |
</remarks> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> | |
<Member MemberName="Sort"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort(class System.Array keys, class System.Array items, int32 index, int32 length)" /> | |
<MemberSignature Language="C#" Value="public static void Sort(Array keys, Array items, int index, int length);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="keys" Type="System.Array" /> | |
<Parameter Name="items" Type="System.Array" /> | |
<Parameter Name="index" Type="System.Int32" /> | |
<Parameter Name="length" Type="System.Int32" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts the specified ranges of the specified pair of | |
one-dimensional <see cref="T:System.Array" /> | |
objects (one containing a set of keys and the other containing corresponding | |
items) based on the keys in the first specified <see cref="T:System.Array" />.</para> | |
</summary> | |
<param name="keys">A one-dimensional <see cref="T:System.Array" /> that contains the keys to sort.</param> | |
<param name="items">A one-dimensional <see cref="T:System.Array" /> that contains the items that correspond to each element in <paramref name="keys" />. Specify a null reference to sort only <paramref name="keys" />.</param> | |
<param name="index">A <see cref="T:System.Int32" /> that contains the index at which sort begins.</param> | |
<param name="length">A <see cref="T:System.Int32" /> that contains the number of elements to sort.</param> | |
<exception cref="T:System.ArgumentNullException"> | |
<para> | |
<paramref name="keys" /> is <see langword="null" />.</para> | |
</exception> | |
<exception cref="T:System.RankException"> | |
<para> | |
<paramref name="keys" /> has more than one dimension.</para> | |
<para> -or-</para> | |
<para> | |
<paramref name="items" /> is not a null reference and has more than one dimension.</para> | |
</exception> | |
<exception cref="T:System.ArgumentOutOfRangeException"> | |
<para> | |
<paramref name="index" /> < <paramref name="keys" />.GetLowerBound(0).</para> | |
<para>-or-</para> | |
<para> | |
<paramref name="length" /> < 0.</para> | |
</exception> | |
<exception cref="T:System.ArgumentException"> | |
<para> | |
<paramref name="items" /> is not a null reference, and <paramref name="keys" />.GetLowerBound(0) does not equal <paramref name="items" />.GetLowerBound(0). </para> | |
<para>-or- </para> | |
<para> | |
<paramref name="index" /> and <paramref name="length" /> do not specify a valid range in <paramref name="keys" />. </para> | |
<para>-or- </para> | |
<para> | |
<paramref name="items" /> is not a null reference, and <paramref name="index" /> and <paramref name="length" /> do not specify a valid range in <paramref name="items" />. </para> | |
</exception> | |
<exception cref="T:System.InvalidOperationException"> | |
<para>One or more elements in <paramref name="keys" /> that are used in a comparison do not implement the <see cref="T:System.IComparable" /> interface.</para> | |
</exception> | |
<remarks> | |
<para>This version of <see cref="M:System.Array.Sort(System.Array)" /> is equivalent to <see cref="M:System.Array.Sort(System.Array)" />(<paramref name="keys" />, <paramref name="items" />, <paramref name="index" />, <paramref name="length" />, <see langword="null" />).</para> | |
<para> Each key in <paramref name="keys" /> is | |
required to have | |
a corresponding item in <paramref name="items" />. The sort is performed according to the | |
order of <paramref name="keys" /> . After a key is repositioned during the sort, | |
the corresponding item in <paramref name="items" /> is similarly | |
repositioned. Therefore, <paramref name="items" /> is sorted according to the arrangement of | |
the corresponding keys in <paramref name="keys" />. If the sort is not successfully | |
completed, the results are undefined.</para> | |
<para>Each element of <paramref name="keys" /> is | |
required to implement the <see cref="T:System.IComparable" /> interface to | |
be capable of comparisons with every other element in <paramref name="keys" />.</para> | |
</remarks> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> | |
<Member MemberName="Sort"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort(class System.Array array)" /> | |
<MemberSignature Language="C#" Value="public static void Sort(Array array);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="array" Type="System.Array" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts the elements of the specified one-dimensional <see cref="T:System.Array" />.</para> | |
</summary> | |
<param name="array">A one-dimensional <see cref="T:System.Array" /> to sort.</param> | |
<exception cref="T:System.ArgumentNullException"> | |
<paramref name="array" /> is <see langword="null" />.</exception> | |
<exception cref="T:System.RankException"> | |
<paramref name="array" /> has more than one dimension.</exception> | |
<exception cref="T:System.InvalidOperationException">One or more elements in <paramref name="array" /> that are used in a comparison do not implement the <see cref="T:System.IComparable" /> interface.</exception> | |
<remarks> | |
<para>This version of <see cref="M:System.Array.Sort(System.Array)" /> is equivalent to <see cref="M:System.Array.Sort(System.Array)" />(<paramref name="array" />, <see langword="null" />, <paramref name="array" />.GetLowerBound(0), | |
<paramref name="array" />.Length, <see langword="null" />).</para> | |
<para>Each element of <paramref name="array" /> is | |
required to implement | |
the <see cref="T:System.IComparable" /> interface to be capable of comparisons with every other | |
element in array.</para> | |
</remarks> | |
<example> | |
<para>This example demonstrates the <see cref="M:System.Array.Sort(System.Array)" /> method.</para> | |
<code lang="C#">using System; | |
public class ArraySortExample { | |
public static void Main() { | |
string[] strAry = { "All's", "well", "that", "ends", "well" }; | |
Console.Write( "The original string array is: " ); | |
foreach ( String str in strAry ) | |
Console.Write( str + " " ); | |
Console.WriteLine(); | |
Array.Sort( strAry ); | |
Console.Write( "The sorted string array is: " ); | |
foreach ( string str in strAry ) | |
Console.Write( str + " " ); | |
} | |
} | |
</code> | |
<para>The output is</para> | |
<c> | |
<para>The original string array is: All's well that ends well</para> | |
<para>The sorted string array is: All's ends that well well</para> | |
</c> | |
</example> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> | |
<Member MemberName="Sort"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort(class System.Array keys, class System.Array items)" /> | |
<MemberSignature Language="C#" Value="public static void Sort(Array keys, Array items);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="keys" Type="System.Array" /> | |
<Parameter Name="items" Type="System.Array" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts the specified pair of one-dimensional <see cref="T:System.Array" /> objects (one | |
containing a set of keys and the other containing corresponding items) based on | |
the keys in the first specified <see cref="T:System.Array" />.</para> | |
</summary> | |
<param name="keys">A one-dimensional <see cref="T:System.Array" /> that contains the keys to sort.</param> | |
<param name="items"> | |
<para>A one-dimensional <see cref="T:System.Array" /> that contains the items that correspond to each of element of <paramref name="keys" />. Specify a null reference to sort only <paramref name="keys" />.</para> | |
</param> | |
<exception cref="T:System.ArgumentNullException"> | |
<para> | |
<paramref name="keys" /> is <see langword="null" />. </para> | |
</exception> | |
<exception cref="T:System.RankException"> | |
<para> | |
<paramref name="keys" /> has more than one dimension.</para> | |
<para>-or-</para> | |
<para> | |
<paramref name="items" /> is not a null reference and has more than one dimension.</para> | |
</exception> | |
<exception cref="T:System.ArgumentException"> | |
<para> | |
<paramref name="items" /> is not a null reference, and <paramref name="keys" />.GetLowerBound(0) does not equal <paramref name="items" />.GetLowerBound(0).</para> | |
<para>-or-</para> | |
<para> | |
<paramref name="items" /> is not a null reference, and <paramref name="keys" />.Length > <paramref name="items" />.Length.</para> | |
</exception> | |
<exception cref="T:System.InvalidOperationException"> | |
<para>One or more elements in <paramref name="keys" /> that are used in a comparison do not implement the <see cref="T:System.IComparable" /> interface.</para> | |
</exception> | |
<remarks> | |
<para> This version of <see cref="M:System.Array.Sort(System.Array)" /> is equivalent to <see cref="M:System.Array.Sort(System.Array)" />(<paramref name="keys" />, <paramref name="items" />, <paramref name="keys" />.GetLowerBound(0), <paramref name="keys" />.Length, <see langword="null" />).</para> | |
<para> Each key in <paramref name="keys" /> is required to have | |
a corresponding item in <paramref name="items" />. The sort is performed according to the | |
order of <paramref name="keys" /> . After a key is repositioned during the sort, | |
the corresponding item in <paramref name="items" /> is similarly repositioned. Only | |
<paramref name="keys" />.Length elements of | |
<paramref name="items" /> are sorted. Therefore, | |
<paramref name="items" /> | |
is sorted according to the arrangement of the corresponding keys in | |
<paramref name="keys" />. If | |
the sort is not successfully completed, the results are unspecified.</para> | |
<para>Each element of <paramref name="keys" /> is | |
required to implement | |
the <see cref="T:System.IComparable" /> interface to be capable of comparisons with every other | |
element in <paramref name="keys" />.</para> | |
</remarks> | |
<example> | |
<para>This example demonstrates the <see cref="M:System.Array.Sort(System.Array)" /> method.</para> | |
<code lang="C#">using System; | |
public class ArraySortExample { | |
public static void Main() { | |
string[] strAry = { "All's", "well", "that", "ends", "well" }; | |
int[] intAry = { 3, 4, 0, 1, 2 }; | |
Console.Write( "The original string array is: " ); | |
foreach ( string str in strAry ) | |
Console.Write( str + " " ); | |
Console.WriteLine(); | |
Console.Write( "The key array is: " ); | |
foreach ( int i in intAry ) | |
Console.Write( i + " " ); | |
Console.WriteLine(); | |
Array.Sort( intAry, strAry ); | |
Console.Write( "The sorted string array is: " ); | |
foreach ( string str in strAry ) | |
Console.Write( str + " " ); | |
} | |
} | |
</code> | |
<para>The output is</para> | |
<c> | |
<para>The original string array is: All's well that ends well</para> | |
<para>The key array is: 3 4 0 1 2</para> | |
<para>The sorted string array is: that ends well All's well</para> | |
</c> | |
</example> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> | |
<Member MemberName="Sort"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort(class System.Array array, int32 index, int32 length)" /> | |
<MemberSignature Language="C#" Value="public static void Sort(Array array, int index, int length);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="array" Type="System.Array" /> | |
<Parameter Name="index" Type="System.Int32" /> | |
<Parameter Name="length" Type="System.Int32" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts the elements in the specified range of the | |
specified one-dimensional <see cref="T:System.Array" />.</para> | |
</summary> | |
<param name="array">A one-dimensional <see cref="T:System.Array" /> to sort.</param> | |
<param name="index">A <see cref="T:System.Int32" /> that contains the index at which sorting starts.</param> | |
<param name="length">A <see cref="T:System.Int32" /> that contains the number of elements to sort.</param> | |
<exception cref="T:System.ArgumentNullException"> | |
<paramref name="array" /> is <see langword="null" />. </exception> | |
<exception cref="T:System.RankException"> | |
<paramref name="array" /> has more than one dimension. </exception> | |
<exception cref="T:System.ArgumentOutOfRangeException"> | |
<para> | |
<paramref name="index" /> < <paramref name="array" />.GetLowerBound(0).</para> | |
<para>-or-</para> | |
<para> | |
<paramref name="length" /> < 0.</para> | |
</exception> | |
<exception cref="T:System.ArgumentException"> | |
<para> | |
<paramref name="index" /> and <paramref name="length" /> do not specify a valid range in <paramref name="array" />.</para> | |
</exception> | |
<exception cref="T:System.InvalidOperationException"> | |
<para>One or more elements in <paramref name="array" /> that are used in a comparison do not implement the <see cref="T:System.IComparable" /> interface.</para> | |
</exception> | |
<remarks> | |
<para>This version of <see cref="M:System.Array.Sort(System.Array)" /> is equivalent to <see cref="M:System.Array.Sort(System.Array)" />(<paramref name="array" />, | |
<see langword="null" /> , <paramref name="index" />, <paramref name="length" />, | |
<see langword="null" />).</para> | |
<para>Each element of <paramref name="array" /> is | |
required to implement | |
the <see cref="T:System.IComparable" /> interface to be capable of comparisons with every other | |
element in <paramref name="array" />. If the sort is not successfully completed, the | |
results are unspecified.</para> | |
</remarks> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> | |
<Member MemberName="Sort<K,V>"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort<K,V>(!!0[] keys, !!1[] items, int32 index, int32 length, class System.Collections.Generic.IComparer`1<!!0> comparer)" /> | |
<MemberSignature Language="C#" Value="public static void Sort<K,V>(K[] keys, V[] items, int index, int length, IComparer<K> comparer);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="keys" Type="K[]" /> | |
<Parameter Name="items" Type="V[]" /> | |
<Parameter Name="index" Type="System.Int32" /> | |
<Parameter Name="length" Type="System.Int32" /> | |
<Parameter Name="comparer" Type="System.Collections.Generic.IComparer<K>" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts a range of elements in a pair of arrays based on the keys in the first array using the specified <see cref="T:System.Collections.Generic.IComparer<K>" />.</para> | |
</summary> | |
<param name="keys"> | |
<para>The array that contains the keys to sort.</para> | |
</param> | |
<param name="items"> | |
<para>The array that contains the items that correspond to each of the keys in <paramref name="keys" />.</para> | |
<para>-or-</para> | |
<para> | |
<see langword="null" /> to sort only the <paramref name="keys" /> array.</para> | |
</param> | |
<param name="index">The starting index of the range to sort.</param> | |
<param name="length">The number of elements in the range to sort.</param> | |
<param name="comparer"> | |
<para>The <see cref="T:System.Collections.Generic.IComparer<K>" /> implementation to use when comparing elements.</para> | |
<para>-or-</para> | |
<para> | |
<see langword="null" /> to use the <see cref="T:System.IComparable<K>" /> or <see cref="T:System.IComparable" /> implementation of each element.</para> | |
</param> | |
<exception cref="T:System.ArgumentException"> | |
<para> | |
<paramref name="index" /> and <paramref name="length" /> do not specify a valid range in <paramref name="keys" />. </para> | |
<para>-or- </para> | |
<para> | |
<paramref name="items" /> is not <see langword="null" />, and <paramref name="index" /> and <paramref name="length" /> do not specify a valid range in <paramref name="items" />.</para> | |
</exception> | |
<exception cref="T:System.ArgumentNullException"> | |
<para> | |
<paramref name="keys" /> is <see langword="null" />.</para> | |
</exception> | |
<exception cref="T:System.ArgumentOutOfRangeException"> | |
<para> | |
<paramref name="index" /> is less than zero.</para> | |
<para>-or-</para> | |
<para> | |
<paramref name="length" /> is less than zero.</para> | |
</exception> | |
<exception cref="T:System.InvalidOperationException"> | |
<para> | |
<paramref name="comparer" /> is <see langword="null" />, and one or more elements in <paramref name="keys" /> that are used in a comparison do not implement the <see cref="T:System.IComparable<K>" /> or <see cref="T: System.IComparable" /> interface.</para> | |
</exception> | |
<remarks> | |
<para>If <paramref name="items" /> is non-null, each key in <paramref name="keys" /> is required to have | |
a corresponding item in <paramref name="items" />. The sort is performed according to the | |
order of <paramref name="keys" />. After a key is repositioned during the sort, | |
the corresponding item in <paramref name="items" /> is similarly repositioned. Only | |
<paramref name="keys" />.Length elements of <paramref name="items" /> will be sorted. Therefore, | |
<paramref name="items" /> is sorted according to the arrangement of | |
the corresponding keys in <paramref name="keys" />. If the sort is not successfully | |
completed, the results are undefined.</para> | |
<para>If <paramref name="comparer" /> is a null reference, each element of <paramref name="keys" /> is required to implement the <see cref="T:System.IComparable<K>" /> or <see cref="T:System.IComparable" /> interface to be capable of comparisons | |
with every other element in <paramref name="keys" />.</para> | |
</remarks> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> | |
<Member MemberName="Sort<K,V>"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort<K,V>(!!0[] keys, !!1[] items, class System.Collections.Generic.IComparer`1<!!0> comparer)" /> | |
<MemberSignature Language="C#" Value="public static void Sort<K,V>(K[] keys, V[] items, IComparer<K> comparer);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="keys" Type="K[]" /> | |
<Parameter Name="items" Type="V[]" /> | |
<Parameter Name="comparer" Type="System.Collections.Generic.IComparer<K>" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts a pair of arrays based on the keys in the first array, using the specified <see cref="T:System.Collections.Generic.IComparer" />.</para> | |
</summary> | |
<param name="keys"> | |
<para>The array that contains the keys to sort.</para> | |
</param> | |
<param name="items"> | |
<para>The array that contains the items that correspond to each of the keys in <paramref name="keys" />.</para> | |
<para>-or-</para> | |
<para> | |
<see langword="null" /> to sort only the <paramref name="keys" /> array.</para> | |
</param> | |
<param name="comparer"> | |
<para>The <see cref="T:System.Collections.Generic.IComparer<K>" /> implementation to use when comparing elements.</para> | |
<para>-or-</para> | |
<para> | |
<see langword="null" /> to use the <see cref="T:System.IComparable<K>" /> or <see cref="T:System.IComparable" /> implementation of each element.</para> | |
</param> | |
<exception cref="T:System.ArgumentNullException"> | |
<para> | |
<paramref name="keys" /> is <see langword="null" />.</para> | |
</exception> | |
<exception cref="T:System.ArgumentException"> | |
<para> | |
<paramref name="items" /> is not <see langword="null" />, and the length of <paramref name="keys" /> does not match the length of <paramref name="items" />.</para> | |
</exception> | |
<exception cref="T:System.InvalidOperationException"> | |
<para> | |
<paramref name="comparer" /> is <see langword="null" />, and one or more elements in <paramref name="keys" /> that are used in a comparison do not implement the <see cref="T:System.IComparable<K>" /> or <see cref="T: System.IComparable" /> interface.</para> | |
</exception> | |
<remarks> | |
<para>This version of <see cref="M:System.Array.Sort" /> is equivalent to <see cref="M:System.Array.Sort<K,V>" /><see langword="(" /><paramref name="keys" /><see langword=", " /><paramref name="items" /><see langword=", " /><see langword="0, " /><paramref name="keys" /><see langword=".Length" /><see langword=", " /><paramref name="comparer" /><see langword=")" />.</para> | |
<para>If <paramref name="items" /> is non-null, each key in <paramref name="keys" /> is required to have | |
a corresponding item in <paramref name="items" />. The sort is performed according to the | |
order of <paramref name="keys" />. After a key is repositioned during the sort, | |
the corresponding item in <paramref name="items" /> is similarly repositioned. Only | |
<paramref name="keys" />.Length elements of <paramref name="items" /> will be sorted. Therefore, | |
<paramref name="items" /> is sorted according to the arrangement of | |
the corresponding keys in <paramref name="keys" />. If the sort is not successfully | |
completed, the results are unspecified.</para> | |
<para>If <paramref name="comparer" /> is a null reference, each element of <paramref name="keys" /> is required to implement the <see cref="T:System.IComparable<K>" /> or <see cref="T:System.IComparable" /> interface to be capable of comparisons | |
with every other element in <paramref name="keys" />.</para> | |
</remarks> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> | |
<Member MemberName="Sort<K,V>"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort<K,V>(!!0[] keys, !!1[] items, int32 index, int32 length)" /> | |
<MemberSignature Language="C#" Value="public static void Sort<K,V>(K[] keys, V[] items, int index, int length);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="keys" Type="K[]" /> | |
<Parameter Name="items" Type="V[]" /> | |
<Parameter Name="index" Type="System.Int32" /> | |
<Parameter Name="length" Type="System.Int32" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts a range of elements in a pair of arrays based on the keys in the first array, using the <see cref="T:System.IComparable<K>" /> or <see cref="T:System.IComparable" /> implementation of each key.</para> | |
</summary> | |
<param name="keys"> | |
<para>The array that contains the keys to sort.</para> | |
</param> | |
<param name="items"> | |
<para>The array that contains the items that correspond to each of the keys in <paramref name="keys" />.</para> | |
<para>-or-</para> | |
<para> | |
<see langword="null" /> to sort only the <paramref name="keys" /> array.</para> | |
</param> | |
<param name="index">The starting index of the range to sort.</param> | |
<param name="length">The number of elements in the range to sort.</param> | |
<exception cref="T:System.ArgumentException"> | |
<para> | |
<paramref name="index" /> and <paramref name="length" /> do not specify a valid range in <paramref name="keys" />. </para> | |
<para>-or- </para> | |
<para> | |
<paramref name="items" /> is not <see langword="null" />, and <paramref name="index" /> and <paramref name="length" /> do not specify a valid range in <paramref name="items" />.</para> | |
</exception> | |
<exception cref="T:System.ArgumentNullException"> | |
<para> | |
<paramref name="keys" /> is <see langword="null" />.</para> | |
</exception> | |
<exception cref="T:System.ArgumentOutOfRangeException"> | |
<para> | |
<paramref name="index" /> is less than zero.</para> | |
<para>-or-</para> | |
<para> | |
<paramref name="length" /> is less than zero.</para> | |
</exception> | |
<exception cref="T:System.InvalidOperationException"> | |
<para>One or more elements in <paramref name="keys" /> that are used in a comparison are the null reference or do not implement the <see cref="T:System.IComparable<K>" /> or <see cref="T: System.IComparable" /> interface.</para> | |
</exception> | |
<remarks> | |
<para>If <paramref name="items" /> is non-null, each key in <paramref name="keys" /> is required to have | |
a corresponding item in <paramref name="items" />. When a key is repositioned during the sorting, | |
the corresponding item in <paramref name="items" /> is similarly repositioned. Therefore, <paramref name="items" /> is sorted according to the arrangement of | |
the corresponding keys in <paramref name="keys" />. </para> | |
<para>If the sort is not successfully completed, the results are unspecified.</para> | |
<para>Each key within the specified range of elements in <paramref name="keys" /> must implement the <see cref="T:System.IComparable<K>" /> or <see cref="T:System.IComparable" /> interface to be capable of comparisons with every other key.</para> | |
<para>This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal.</para> | |
</remarks> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> | |
<Member MemberName="Sort<K,V>"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort<K,V>(!!0[] keys, !!1[] items)" /> | |
<MemberSignature Language="C#" Value="public static void Sort<K,V>(K[] keys, V[] items);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="keys" Type="K[]" /> | |
<Parameter Name="items" Type="V[]" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts a pair of arrays based on the keys in the first array using the <see cref="T:System.IComparable" /> implementation of each key.</para> | |
</summary> | |
<param name="keys"> | |
<para>The array that contains the keys to sort.</para> | |
</param> | |
<param name="items"> | |
<para>The array that contains the items that correspond to each of the keys in <paramref name="keys" />.</para> | |
<para>-or-</para> | |
<para> | |
<see langword="null" /> to sort only the <paramref name="keys" /> array.</para> | |
</param> | |
<exception cref="T:System.ArgumentException"> | |
<para> | |
<paramref name="items" /> is not <see langword="null" />, and the length of <paramref name="keys" /> does not equal the length of <paramref name="items" />.</para> | |
</exception> | |
<exception cref="T:System.ArgumentNullException"> | |
<para> | |
<paramref name="keys" /> is <see langword="null" />.</para> | |
</exception> | |
<exception cref="T:System.InvalidOperationException"> | |
<para>One or more elements in <paramref name="keys" /> that are used in a comparison are the null reference or do not implement the <see cref="T:System.IComparable<K>" /> or <see cref="T: System.IComparable" /> interface.</para> | |
</exception> | |
<remarks> | |
<para>If <paramref name="items" /> is non-null, each key in <paramref name="keys" /> is required to have | |
a corresponding item in <paramref name="items" />. When a key is repositioned during the sorting, | |
the corresponding item in <paramref name="items" /> is similarly repositioned. Therefore, <paramref name="items" /> is sorted according to the arrangement of | |
the corresponding keys in <paramref name="keys" />. </para> | |
<para>Each key in <paramref name="keys" /> must implement the <see cref="T:System.IComparable<K>" /> or <see cref="T:System.IComparable" /> interface to be capable of comparisons with every other key.</para> | |
<para>If the sort is not successfully completed, the results are undefined.</para> | |
<para>This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal.</para> | |
</remarks> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> | |
<Member MemberName="Sort<T>"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort<T>(!!0[] array, int32 index, int32 length, class System.Collections.Generic.IComparer`1<!!0> comparer)" /> | |
<MemberSignature Language="C#" Value="public static void Sort<T>(T[] array, int index, int length, IComparer<T> comparer);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="array" Type="T[]" /> | |
<Parameter Name="index" Type="System.Int32" /> | |
<Parameter Name="length" Type="System.Int32" /> | |
<Parameter Name="comparer" Type="System.Collections.Generic.IComparer<T>" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts the elements in a range of elements in an array using the specified comparer.</para> | |
</summary> | |
<param name="array"> | |
<para>The array to sort.</para> | |
</param> | |
<param name="index">The starting index of the range to sort.</param> | |
<param name="length">The number of elements in the range to sort.</param> | |
<param name="comparer"> | |
<para>The <see cref="T:System.Collections.Generic.IComparer<K>" /> implementation to use when comparing elements.</para> | |
<para>-or-</para> | |
<para> | |
<see langword="null" /> to use the <see cref="T:System.IComparable<K>" /> or <see cref="T:System.IComparable" /> implementation of each element.</para> | |
</param> | |
<exception cref="T:System.ArgumentNullException"> | |
<para> | |
<paramref name="array" /> is <see langword="null" />.</para> | |
</exception> | |
<exception cref="T:System.ArgumentOutOfRangeException"> | |
<para> | |
<paramref name="index" /> is less than zero.</para> | |
<para>-or-</para> | |
<para> | |
<paramref name="length" /> is less than zero.</para> | |
</exception> | |
<exception cref="T:System.ArgumentException"> | |
<para> | |
<paramref name="index" /> and <paramref name="length" /> do not specify a valid range in <paramref name="array" />. </para> | |
</exception> | |
<exception cref="T:System.InvalidOperationException"> | |
<para> | |
<paramref name="comparer" /> is <see langword="null" />, and one or more elements in <paramref name="array" /> that are used in a comparison do not implement the <see cref="T:System.IComparable<K>" /> or <see cref="T: System.IComparable" /> interface.</para> | |
</exception> | |
<remarks> | |
<para>If <paramref name="comparer" /> is null, each element within the specified range of elements in <paramref name="array" /> must implement the <see cref="T:System.IComparable" /> interface to be capable of comparisons with every other element in <paramref name="array" />.</para> | |
<para>If the sort is not successfully completed, the results are undefined.</para> | |
<para>This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal.</para> | |
</remarks> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> | |
<Member MemberName="Sort<T>"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort<T>(!!0[] array, class System.Collections.Generic.IComparer`1<!!0> comparer)" /> | |
<MemberSignature Language="C#" Value="public static void Sort<T>(T[] array, IComparer<T> comparer);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="array" Type="T[]" /> | |
<Parameter Name="comparer" Type="System.Collections.Generic.IComparer<T>" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts the elements in an array using the specified comparer.</para> | |
</summary> | |
<param name="array"> | |
<para>The array to sort.</para> | |
</param> | |
<param name="comparer"> | |
<para>The <see cref="T:System.Collections.Generic.IComparer<T>" /> implementation to use when comparing elements.</para> | |
<para>-or-</para> | |
<para> | |
<see langword="null" /> to use the <see cref="T:System.IComparable<T>" /> or <see cref="T:System.IComparable" /> implementation of each element.</para> | |
</param> | |
<exception cref="T:System.ArgumentNullException"> | |
<para> | |
<paramref name="array" /> is <see langword="null" />.</para> | |
</exception> | |
<exception cref="T:System.InvalidOperationException"> | |
<para> | |
<paramref name="comparer" /> is <see langword="null" />, and one or more elements in <paramref name="array" /> that are used in a comparison do not implement the <see cref="T:System.IComparable<T>" /> or <see cref="T: System.IComparable" /> interface.</para> | |
</exception> | |
<remarks> | |
<para>If <paramref name="comparer" /> is null, each element of <paramref name="array" /> must implement the <see cref="T:System.IComparable<T>" /> or <see cref="T:System.IComparable" /> interface to be capable of comparisons with every other element in <paramref name="array" />.</para> | |
<para>If the sort is not successfully completed, the results are undefined.</para> | |
<para>This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal.</para> | |
</remarks> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> | |
<Member MemberName="Sort<T>"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort<T>(!!0[] array, class System.Comparison`1<!!0> comparison)" /> | |
<MemberSignature Language="C#" Value="public static void Sort<T>(T[] array, Comparison<T> comparison);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="array" Type="T[]" /> | |
<Parameter Name="comparison" Type="System.Comparison<T>" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts the elements in an array using the specified comparison.</para> | |
</summary> | |
<param name="array"> | |
<para>The array to sort.</para> | |
</param> | |
<param name="comparison"> | |
<para>The <see cref="T:System.Comparison<T>" /> to use when comparing elements.</para> | |
</param> | |
<exception cref="T:System.ArgumentNullException"> | |
<para> | |
<paramref name="array" /> is <see langword="null" />.</para> | |
<para>-or-</para> | |
<para> | |
<paramref name="comparison" /> is <see langword="null" />.</para> | |
</exception> | |
<remarks> | |
<para>If the sort is not successfully completed, the results are undefined.</para> | |
<para>This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal.</para> | |
</remarks> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> | |
<Member MemberName="Sort<T>"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort<T>(!!0[] array)" /> | |
<MemberSignature Language="C#" Value="public static void Sort<T>(T[] array);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="array" Type="T[]" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts the elements in an entire array using the <see cref="T:System.IComparable<T>" /> or <see cref="T:System.IComparable" /> implementation of each element of that array.</para> | |
</summary> | |
<param name="array"> | |
<para>The array to sort.</para> | |
</param> | |
<exception cref="T:System.ArgumentNullException"> | |
<para> | |
<paramref name="array" /> is <see langword="null" />.</para> | |
</exception> | |
<exception cref="T:System.InvalidOperationException"> | |
<para>One or more elements in <paramref name="array" /> that are used in a comparison are the null reference or do not implement the <see cref="T:System.IComparable<T>" /> or <see cref="T: System.IComparable" /> interface.</para> | |
</exception> | |
<remarks> | |
<para>Each element of <paramref name="array" /> is required to implement the <see cref="T:System.IComparable<T>" /> or <see cref="T:System.IComparable" /> interface to be capable of comparisons with every other element in <paramref name="array" />.</para> | |
<para>If the sort is not successfully completed, the results are undefined.</para> | |
<para>This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal.</para> | |
</remarks> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> | |
<Member MemberName="Sort<T>"> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort<T>(!!0[] array, int32 index, int32 length)" /> | |
<MemberSignature Language="C#" Value="public static void Sort<T>(T[] array, int index, int length);" /> | |
<MemberType>Method</MemberType> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="array" Type="T[]" /> | |
<Parameter Name="index" Type="System.Int32" /> | |
<Parameter Name="length" Type="System.Int32" /> | |
</Parameters> | |
<Docs> | |
<summary> | |
<para>Sorts an array using the <see cref="T:System.IComparable<T>" /> or <see cref="T:System.IComparable" /> implementation of each element of that array.</para> | |
</summary> | |
<param name="array"> | |
<para>The array to sort.</para> | |
</param> | |
<param name="index">The starting index of the range to sort.</param> | |
<param name="length">The number of elements in the range to sort.</param> | |
<exception cref="T:System.ArgumentException"> | |
<para> | |
<paramref name="index" /> and <paramref name="length" /> do not specify a valid range in <paramref name="array" />. </para> | |
</exception> | |
<exception cref="T:System.ArgumentNullException"> | |
<para> | |
<paramref name="array" /> is <see langword="null" />.</para> | |
</exception> | |
<exception cref="T:System.ArgumentOutOfRangeException"> | |
<para> | |
<paramref name="index" /> is less than zero.</para> | |
<para>-or-</para> | |
<para> | |
<paramref name="length" /> is less than zero.</para> | |
</exception> | |
<exception cref="T:System.InvalidOperationException"> | |
<para>One or more elements in <paramref name="array" /> that are used in a comparison do not implement the <see cref="T:System.IComparable<T>" /> or <see cref="T: System.IComparable" /> interface.</para> | |
</exception> | |
<remarks> | |
<para>Each element within the specified range of elements in <paramref name="array" /> must implement the <see cref="T:System.IComparable<T>" /> or <see cref="T:System.IComparable" /> interface to be capable of comparisons with every other element in <paramref name="array" />.</para> | |
<para>If the sort is not successfully completed, the results are undefined.</para> | |
<para>This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal.</para> | |
</remarks> | |
</Docs> | |
<Excluded>0</Excluded> | |
</Member> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment