語言

ImmutableList<T>.Sort 方法

定義

多載

名稱 Description
Sort()

使用預設比較子來排序整個不可變清單中的元素。

Sort(IComparer<T>)

使用指定的比較子,排序整個不可變清單中的專案。

Sort(Comparison<T>)

使用指定的比較子,排序整個不可變清單中的專案。

Sort(Int32, Int32, IComparer<T>)

使用指定的比較子,排序不可變清單中的項目範圍。

Sort()

來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs

使用預設比較子來排序整個不可變清單中的元素。

public:
 System::Collections::Immutable::ImmutableList<T> ^ Sort();
public System.Collections.Immutable.ImmutableList<T> Sort();
member this.Sort : unit -> System.Collections.Immutable.ImmutableList<'T>
Public Function Sort () As ImmutableList(Of T)

傳回

排序好的清單。

適用於

Sort(IComparer<T>)

來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs

使用指定的比較子,排序整個不可變清單中的專案。

public:
 System::Collections::Immutable::ImmutableList<T> ^ Sort(System::Collections::Generic::IComparer<T> ^ comparer);
public System.Collections.Immutable.ImmutableList<T> Sort(System.Collections.Generic.IComparer<T> comparer);
public System.Collections.Immutable.ImmutableList<T> Sort(System.Collections.Generic.IComparer<T>? comparer);
member this.Sort : System.Collections.Generic.IComparer<'T> -> System.Collections.Immutable.ImmutableList<'T>
Public Function Sort (comparer As IComparer(Of T)) As ImmutableList(Of T)

參數

comparer
IComparer<T>

比較元素時使用的實作,或 null 使用預設的比較器(Default)。

傳回

排序好的清單。

適用於

Sort(Comparison<T>)

來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs

使用指定的比較子,排序整個不可變清單中的專案。

public:
 System::Collections::Immutable::ImmutableList<T> ^ Sort(Comparison<T> ^ comparison);
public System.Collections.Immutable.ImmutableList<T> Sort(Comparison<T> comparison);
member this.Sort : Comparison<'T> -> System.Collections.Immutable.ImmutableList<'T>
Public Function Sort (comparison As Comparison(Of T)) As ImmutableList(Of T)

參數

comparison
Comparison<T>

在比較元素時,代表會使用。

傳回

排序好的清單。

例外狀況

comparison 是 null。

適用於

Sort(Int32, Int32, IComparer<T>)

來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs

使用指定的比較子,排序不可變清單中的項目範圍。

public:
 System::Collections::Immutable::ImmutableList<T> ^ Sort(int index, int count, System::Collections::Generic::IComparer<T> ^ comparer);
public System.Collections.Immutable.ImmutableList<T> Sort(int index, int count, System.Collections.Generic.IComparer<T> comparer);
public System.Collections.Immutable.ImmutableList<T> Sort(int index, int count, System.Collections.Generic.IComparer<T>? comparer);
member this.Sort : int * int * System.Collections.Generic.IComparer<'T> -> System.Collections.Immutable.ImmutableList<'T>
Public Function Sort (index As Integer, count As Integer, comparer As IComparer(Of T)) As ImmutableList(Of T)

參數

index
Int32

排序範圍的零基起始索引。

count
Int32

範圍的長度需要分類。

comparer
IComparer<T>

比較元素時使用的實作,或 null 使用預設的比較器(Default)。

傳回

排序好的清單。

適用於