ImmutableArray<T>.Sort 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| Sort() |
使用默认比较器对不可变数组中的元素进行排序。 |
| Sort(IComparer<T>) |
使用指定的比较器对不可变数组中的元素进行排序。 |
| Sort(Comparison<T>) |
使用指定的ImmutableArray<T>元素对整个Comparison<T>元素进行排序。 |
| Sort(Int32, Int32, IComparer<T>) |
使用指定的比较器对不可变数组中的指定元素进行排序。 |
Sort()
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
使用默认比较器对不可变数组中的元素进行排序。
public:
System::Collections::Immutable::ImmutableArray<T> Sort();
public System.Collections.Immutable.ImmutableArray<T> Sort();
member this.Sort : unit -> System.Collections.Immutable.ImmutableArray<'T>
Public Function Sort () As ImmutableArray(Of T)
返回
一个新的不可变数组,其中包含此数组中的项,按排序顺序。
适用于
Sort(IComparer<T>)
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
使用指定的比较器对不可变数组中的元素进行排序。
public:
System::Collections::Immutable::ImmutableArray<T> Sort(System::Collections::Generic::IComparer<T> ^ comparer);
public System.Collections.Immutable.ImmutableArray<T> Sort(System.Collections.Generic.IComparer<T> comparer);
public System.Collections.Immutable.ImmutableArray<T> Sort(System.Collections.Generic.IComparer<T>? comparer);
member this.Sort : System.Collections.Generic.IComparer<'T> -> System.Collections.Immutable.ImmutableArray<'T>
Public Function Sort (comparer As IComparer(Of T)) As ImmutableArray(Of T)
参数
- comparer
- IComparer<T>
比较元素时要使用的实现,或使用 null 默认比较器。
返回
一个新的不可变数组,其中包含此数组中的项,按排序顺序。
适用于
Sort(Comparison<T>)
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
使用指定的ImmutableArray<T>元素对整个Comparison<T>元素进行排序。
public:
System::Collections::Immutable::ImmutableArray<T> Sort(Comparison<T> ^ comparison);
public System.Collections.Immutable.ImmutableArray<T> Sort(Comparison<T> comparison);
member this.Sort : Comparison<'T> -> System.Collections.Immutable.ImmutableArray<'T>
Public Function Sort (comparison As Comparison(Of T)) As ImmutableArray(Of T)
参数
- comparison
- Comparison<T>
Comparison<T>比较元素时要使用的元素。
返回
已排序的列表。
例外
comparison 为 null。
适用于
Sort(Int32, Int32, IComparer<T>)
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
- Source:
- ImmutableArray_1.cs
使用指定的比较器对不可变数组中的指定元素进行排序。
public:
System::Collections::Immutable::ImmutableArray<T> Sort(int index, int count, System::Collections::Generic::IComparer<T> ^ comparer);
public System.Collections.Immutable.ImmutableArray<T> Sort(int index, int count, System.Collections.Generic.IComparer<T> comparer);
public System.Collections.Immutable.ImmutableArray<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.ImmutableArray<'T>
Public Function Sort (index As Integer, count As Integer, comparer As IComparer(Of T)) As ImmutableArray(Of T)
参数
- index
- Int32
要排序的第一个元素的索引。
- count
- Int32
要包含在排序中的元素数。
- comparer
- IComparer<T>
比较元素时要使用的实现,或使用 null 默认比较器。
返回
一个新的不可变数组,其中包含此数组中的项,按排序顺序。