PropertyDescriptorCollection.Sort 方法

定义

对此集合中的成员排序。

重载

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为 、 BCD的对象,则 的属性myNewColl将按 、、 BAC的顺序D排序。

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)

对此集合中的成员排序。 首先应用指定的顺序,然后使用指定的 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为 、 BCD的对象,则 的属性myNewColl将按 、、 BAC的顺序D排序。

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

另请参阅

适用于