PropertyDescriptorCollection.Sort PropertyDescriptorCollection.Sort PropertyDescriptorCollection.Sort PropertyDescriptorCollection.Sort Method

定義

排序這個集合的成員。Sorts the members of this collection.

多載

Sort() Sort() Sort() Sort()

使用這個集合的預設排序,通常是依字母順序,排序這個集合的成員。Sorts the members of this collection, using the default sort for this collection, which is usually alphabetical.

Sort(IComparer) Sort(IComparer) Sort(IComparer) Sort(IComparer)

使用指定的 IComparer,排序這個集合的成員。Sorts the members of this collection, using the specified IComparer.

Sort(String[]) Sort(String[]) Sort(String[]) Sort(String[])

排序這個集合的成員。Sorts the members of this collection. 首先會套用指定的順序,其後是這個集合的預設排序,通常是依字母順序。The specified order is applied first, followed by the default sort for this collection, which is usually alphabetical.

Sort(String[], IComparer) Sort(String[], IComparer) Sort(String[], IComparer) Sort(String[], IComparer)

排序這個集合的成員。Sorts the members of this collection. 首先會套用指定的順序,其後是使用指定 IComparer 的排序。The specified order is applied first, followed by the sort using the specified IComparer.

Sort() Sort() Sort() Sort()

使用這個集合的預設排序,通常是依字母順序,排序這個集合的成員。Sorts the members of this collection, using the default sort for this collection, which is usually alphabetical.

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

傳回

Sort(IComparer) Sort(IComparer) Sort(IComparer) Sort(IComparer)

使用指定的 IComparer,排序這個集合的成員。Sorts the members of this collection, using the specified IComparer.

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 IComparer IComparer IComparer

比較子,用於將這個集合中的 PropertyDescriptor 物件排序。A comparer to use to sort the PropertyDescriptor objects in this collection.

傳回

另請參閱

Sort(String[]) Sort(String[]) Sort(String[]) Sort(String[])

排序這個集合的成員。Sorts the members of this collection. 首先會套用指定的順序,其後是這個集合的預設排序,通常是依字母順序。The specified order is applied first, followed by the default sort for this collection, which is usually alphabetical.

public:
 virtual System::ComponentModel::PropertyDescriptorCollection ^ Sort(cli::array <System::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 物件排序的順序。An array of strings describing the order in which to sort the PropertyDescriptor objects in this collection.

傳回

範例

下列程式碼範例會定義排序次序Sort方法。The following code example defines the sort order for the Sort method. 如果PropertyDescriptorCollection包含四個PropertyDescriptor具有名稱的物件ABC,和D,屬性myNewColl會依照順序DBA,和CIf the PropertyDescriptorCollection contains four PropertyDescriptor objects with the names A, B, C, and D, the properties of myNewColl would be sorted in the order D, B, A, and C.

array<String^>^ temp0 = {"D","B"};
myNewColl = this->Sort( temp0 );
myNewColl = this.Sort(new string[]{"D", "B"});
myNewColl = Me.Sort(New String() {"D", "B"})
另請參閱

Sort(String[], IComparer) Sort(String[], IComparer) Sort(String[], IComparer) Sort(String[], IComparer)

排序這個集合的成員。Sorts the members of this collection. 首先會套用指定的順序,其後是使用指定 IComparer 的排序。The specified order is applied first, followed by the sort using the specified 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);
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 物件排序的順序。An array of strings describing the order in which to sort the PropertyDescriptor objects in this collection.

comparer
IComparer IComparer IComparer IComparer

比較子,用於將這個集合中的 PropertyDescriptor 物件排序。A comparer to use to sort the PropertyDescriptor objects in this collection.

傳回

範例

下列程式碼範例會定義排序次序Sort方法。The following code example defines the sort order for the Sort method. 如果PropertyDescriptorCollection包含四個PropertyDescriptor具有名稱的物件ABC,和D,屬性myNewColl會依照順序DBA,和CIf the PropertyDescriptorCollection contains four PropertyDescriptor objects with the names A, B, C, and D, the properties of myNewColl would be sorted in the order D, B, A, and C.

array<String^>^ temp0 = {"D","B"};
myNewColl = this->Sort( temp0 );
myNewColl = this.Sort(new string[]{"D", "B"});
myNewColl = Me.Sort(New String() {"D", "B"})
另請參閱

適用於