PropertyDescriptorCollection.Sort 方法

定义

对此集合中的成员排序。Sorts the members of this collection.

重载

Sort()

使用该集合的默认排序(通常为字母顺序)对集合中的成员进行排序。Sorts the members of this collection, using the default sort for this collection, which is usually alphabetical.

Sort(IComparer)

使用指定的 IComparer 对此集合中的成员排序。Sorts the members of this collection, using the specified IComparer.

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)

对此集合中的成员排序。Sorts the members of this collection. 首先应用指定的顺序,然后使用指定的 IComparer 进行排序。The specified order is applied first, followed by the sort using the specified IComparer.

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

返回

PropertyDescriptorCollection

新的 PropertyDescriptorCollection,它包含排序的 PropertyDescriptor 对象。A new PropertyDescriptorCollection that contains the sorted PropertyDescriptor objects.

适用于

产品 Introduced

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

用来将此集合中的 PropertyDescriptor 对象排序的比较器。A comparer to use to sort the PropertyDescriptor objects in this collection.

返回

PropertyDescriptorCollection

新的 PropertyDescriptorCollection,它包含排序的 PropertyDescriptor 对象。A new PropertyDescriptorCollection that contains the sorted PropertyDescriptor objects.

另请参阅

适用于

产品 Introduced

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.

返回

PropertyDescriptorCollection

新的 PropertyDescriptorCollection,它包含排序的 PropertyDescriptor 对象。A new PropertyDescriptorCollection that contains the sorted PropertyDescriptor objects.

示例

下面的代码示例定义方法的排序顺序 SortThe following code example defines the sort order for the Sort method. 如果 PropertyDescriptorCollection 包含四个 PropertyDescriptor 名为、和的对象,则的属性将按 A B C D myNewColl 顺序 D 、、和排序 B A 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"})

另请参阅

适用于

产品 Introduced

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

用来将此集合中的 PropertyDescriptor 对象排序的比较器。A comparer to use to sort the PropertyDescriptor objects in this collection.

返回

PropertyDescriptorCollection

新的 PropertyDescriptorCollection,它包含排序的 PropertyDescriptor 对象。A new PropertyDescriptorCollection that contains the sorted PropertyDescriptor objects.

示例

下面的代码示例定义方法的排序顺序 SortThe following code example defines the sort order for the Sort method. 如果 PropertyDescriptorCollection 包含四个 PropertyDescriptor 名为、和的对象,则的属性将按 A B C D myNewColl 顺序 D 、、和排序 B A 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"})

另请参阅

适用于

产品 Introduced