Click or drag to resize
ArraySortTKey, TValue Method (TKey, TValue)
Sorts a pair of Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first Array using the IComparableT generic interface implementation of each key.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static void Sort<TKey, TValue>(
	TKey[] keys,
	TValue[] items
)

Parameters

keys
Type: TKey
The one-dimensional, zero-based Array that contains the keys to sort.
items
Type: TValue
The one-dimensional, zero-based Array that contains the items that correspond to the keys in keys, or null to sort only keys.

Type Parameters

TKey
The type of the elements of the key array.
TValue
The type of the elements of the items array.
Exceptions
ExceptionCondition
ArgumentNullExceptionkeys is null.
ArgumentExceptionitems is not null, and the lower bound of keys does not match the lower bound of items.-or-items is not null, and the length of keys is greater than the length of items.
InvalidOperationExceptionOne or more elements in the keysArray do not implement the IComparableT generic interface.
See Also