PropertyDescriptorCollection.Sort 方法

定義

排序這個集合的成員。

多載

Sort()

使用這個集合的預設排序,通常是依字母順序,排序這個集合的成員。

Sort(IComparer)

使用指定的 IComparer,排序這個集合的成員。

Sort(String[])

排序這個集合的成員。 首先會套用指定的順序,其後是這個集合的預設排序,通常是依字母順序。

Sort(String[], IComparer)

排序這個集合的成員。 首先會套用指定的順序,其後是使用指定 IComparer 的排序。

Sort()

來源:
PropertyDescriptorCollection.cs
來源:
PropertyDescriptorCollection.cs
來源:
PropertyDescriptorCollection.cs

使用這個集合的預設排序,通常是依字母順序,排序這個集合的成員。

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)

來源:
PropertyDescriptorCollection.cs
來源:
PropertyDescriptorCollection.cs
來源:
PropertyDescriptorCollection.cs

使用指定的 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[])

來源:
PropertyDescriptorCollection.cs
來源:
PropertyDescriptorCollection.cs
來源:
PropertyDescriptorCollection.cs

排序這個集合的成員。 首先會套用指定的順序,其後是這個集合的預設排序,通常是依字母順序。

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如果 包含名稱為 ABCD的四PropertyDescriptor個物件,則 的屬性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)

來源:
PropertyDescriptorCollection.cs
來源:
PropertyDescriptorCollection.cs
來源:
PropertyDescriptorCollection.cs

排序這個集合的成員。 首先會套用指定的順序,其後是使用指定 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如果 包含名稱為 ABCD的四PropertyDescriptor個物件,則 的屬性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"})

另請參閱

適用於