編輯

共用方式為


ComparerExtensions.GetReversed<TElement> Method

Definition

Gets a comparer that sorts elements in the opposite order of the original comparer.

public:
generic <typename TElement>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IComparer<TElement> ^ GetReversed(System::Collections::Generic::IComparer<TElement> ^ originalComparer);
public static System.Collections.Generic.IComparer<TElement> GetReversed<TElement> (this System.Collections.Generic.IComparer<TElement> originalComparer);
static member GetReversed : System.Collections.Generic.IComparer<'Element> -> System.Collections.Generic.IComparer<'Element>
<Extension()>
Public Function GetReversed(Of TElement) (originalComparer As IComparer(Of TElement)) As IComparer(Of TElement)

Type Parameters

TElement

The type of element the comparer compares.

Parameters

originalComparer
IComparer<TElement>

The comparer whose order should be reversed.

Returns

IComparer<TElement>

A comparer that sorts elements in the opposite order of originalComparer.

Applies to