PropertyDescriptorCollection.Sort 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
分類這個收藏的成員。
多載
| 名稱 | Description |
|---|---|
| Sort() |
用該集合的預設排序方式(通常是按字母順序)排序此集合的成員。 |
| Sort(IComparer) |
利用指定的 IComparer排序集合成員。 |
| Sort(String[]) |
分類這個收藏的成員。 先套用指定的排序,接著是該集合的預設排序,通常是按字母順序排列。 |
| Sort(String[], IComparer) |
分類這個收藏的成員。 先套用指定的排序,接著使用指定的 IComparer排序。 |
Sort()
用該集合的預設排序方式(通常是按字母順序)排序此集合的成員。
public:
virtual System::ComponentModel::PropertyDescriptorCollection ^ Sort();
public virtual System.ComponentModel.PropertyDescriptorCollection Sort();
abstract member Sort : unit -> System.ComponentModel.PropertyDescriptorCollection
override this.Sort : unit -> System.ComponentModel.PropertyDescriptorCollection
Public Overridable Function Sort () As PropertyDescriptorCollection
傳回
一個 PropertyDescriptorCollection 包含已排序物件 PropertyDescriptor 的新檔案。
適用於
Sort(IComparer)
利用指定的 IComparer排序集合成員。
public:
virtual System::ComponentModel::PropertyDescriptorCollection ^ Sort(System::Collections::IComparer ^ comparer);
public virtual System.ComponentModel.PropertyDescriptorCollection Sort(System.Collections.IComparer? comparer);
public virtual System.ComponentModel.PropertyDescriptorCollection Sort(System.Collections.IComparer comparer);
abstract member Sort : System.Collections.IComparer -> System.ComponentModel.PropertyDescriptorCollection
override this.Sort : System.Collections.IComparer -> System.ComponentModel.PropertyDescriptorCollection
Public Overridable Function Sort (comparer As IComparer) As PropertyDescriptorCollection
參數
- comparer
- IComparer
一個用來排序 PropertyDescriptor 此集合物件的比較器。
傳回
一個 PropertyDescriptorCollection 包含已排序物件 PropertyDescriptor 的新檔案。
另請參閱
適用於
Sort(String[])
分類這個收藏的成員。 先套用指定的排序,接著是該集合的預設排序,通常是按字母順序排列。
public:
virtual System::ComponentModel::PropertyDescriptorCollection ^ Sort(cli::array <System::String ^> ^ names);
public virtual System.ComponentModel.PropertyDescriptorCollection Sort(string[]? names);
public virtual System.ComponentModel.PropertyDescriptorCollection Sort(string[] names);
abstract member Sort : string[] -> System.ComponentModel.PropertyDescriptorCollection
override this.Sort : string[] -> System.ComponentModel.PropertyDescriptorCollection
Public Overridable Function Sort (names As String()) As PropertyDescriptorCollection
參數
- names
- String[]
一組字串陣列,描述此集合中 PropertyDescriptor 物件排序的順序。
傳回
一個 PropertyDescriptorCollection 包含已排序物件 PropertyDescriptor 的新檔案。
範例
以下程式碼範例定義了該 Sort 方法的排序順序。 若包含四個名稱分別為 、 PropertyDescriptorCollection、 PropertyDescriptor、 A的物件,則 的B性質將依序C排序為 、 D、 myNewCollD、 和 。BAC
array<String^>^ temp0 = {"D","B"};
myNewColl = this->Sort( temp0 );
myNewColl = Sort(["D", "B"]);
myNewColl = Me.Sort(New String() {"D", "B"})
另請參閱
適用於
Sort(String[], IComparer)
分類這個收藏的成員。 先套用指定的排序,接著使用指定的 IComparer排序。
public:
virtual System::ComponentModel::PropertyDescriptorCollection ^ Sort(cli::array <System::String ^> ^ names, System::Collections::IComparer ^ comparer);
public virtual System.ComponentModel.PropertyDescriptorCollection Sort(string[]? names, System.Collections.IComparer? comparer);
public virtual System.ComponentModel.PropertyDescriptorCollection Sort(string[] names, System.Collections.IComparer comparer);
abstract member Sort : string[] * System.Collections.IComparer -> System.ComponentModel.PropertyDescriptorCollection
override this.Sort : string[] * System.Collections.IComparer -> System.ComponentModel.PropertyDescriptorCollection
Public Overridable Function Sort (names As String(), comparer As IComparer) As PropertyDescriptorCollection
參數
- names
- String[]
一組字串陣列,描述此集合中 PropertyDescriptor 物件排序的順序。
- comparer
- IComparer
一個用來排序 PropertyDescriptor 此集合物件的比較器。
傳回
一個 PropertyDescriptorCollection 包含已排序物件 PropertyDescriptor 的新檔案。
範例
以下程式碼範例定義了該 Sort 方法的排序順序。 若包含四個名稱分別為 、 PropertyDescriptorCollection、 PropertyDescriptor、 A的物件,則 的B性質將依序C排序為 、 D、 myNewCollD、 和 。BAC
array<String^>^ temp0 = {"D","B"};
myNewColl = this->Sort( temp0 );
myNewColl = Sort(["D", "B"]);
myNewColl = Me.Sort(New String() {"D", "B"})