EventDescriptorCollection.Sort 方法

定義

排序這個 EventDescriptorCollection 的成員。

多載

Sort(String[], IComparer)

提供指定的排序順序和 EventDescriptorCollection,排序這個 IComparer 的成員。

Sort(String[])

提供指定的排序順序,排序這個 EventDescriptorCollection 的成員。

Sort()

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

Sort(IComparer)

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

Sort(String[], IComparer)

提供指定的排序順序和 EventDescriptorCollection,排序這個 IComparer 的成員。

public:
 virtual System::ComponentModel::EventDescriptorCollection ^ Sort(cli::array <System::String ^> ^ names, System::Collections::IComparer ^ comparer);
public virtual System.ComponentModel.EventDescriptorCollection Sort (string[] names, System.Collections.IComparer comparer);
abstract member Sort : string[] * System.Collections.IComparer -> System.ComponentModel.EventDescriptorCollection
override this.Sort : string[] * System.Collections.IComparer -> System.ComponentModel.EventDescriptorCollection
Public Overridable Function Sort (names As String(), comparer As IComparer) As EventDescriptorCollection

參數

names
String[]

字串的陣列,描述要將這個集合中 EventDescriptor 物件排序的順序。

comparer
IComparer

IComparer,要用於排序這個集合中的 EventDescriptor 物件。

傳回

EventDescriptorCollection

新的 EventDescriptorCollection

範例

下列程式碼範例會定義 方法的 Sort 排序次序。 EventDescriptorCollection如果 包含名稱為 、 BCD 的四 EventDescriptor 個 物件 A ,則 的屬性 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"})

備註

會先套用指定的排序次序,後面接著使用指定的 IComparer 排序。

注意

HostProtectionAttribute套用至這個類別的屬性具有下列 Resources 屬性值: SynchronizationHostProtectionAttribute 不會影響桌面應用程式 (這些應用程式的啟動方式一般都是按兩下圖示、輸入命令或在瀏覽器輸入 URL)。 如需詳細資訊,請參閱 類別 HostProtectionAttributeSQL Server程式設計和主機保護屬性

另請參閱

適用於

Sort(String[])

提供指定的排序順序,排序這個 EventDescriptorCollection 的成員。

public:
 virtual System::ComponentModel::EventDescriptorCollection ^ Sort(cli::array <System::String ^> ^ names);
public virtual System.ComponentModel.EventDescriptorCollection Sort (string[] names);
abstract member Sort : string[] -> System.ComponentModel.EventDescriptorCollection
override this.Sort : string[] -> System.ComponentModel.EventDescriptorCollection
Public Overridable Function Sort (names As String()) As EventDescriptorCollection

參數

names
String[]

字串的陣列,描述要將這個集合中 EventDescriptor 物件排序的順序。

傳回

EventDescriptorCollection

新的 EventDescriptorCollection

範例

下列程式碼範例會定義 方法的 Sort 排序次序。 EventDescriptorCollection如果 包含名稱為 、 BCD 的四 EventDescriptor 個 物件 A ,則 的屬性 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"})

備註

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

注意

HostProtectionAttribute套用至這個類別的屬性具有下列 Resources 屬性值: SynchronizationHostProtectionAttribute 不會影響桌面應用程式 (這些應用程式的啟動方式一般都是按兩下圖示、輸入命令或在瀏覽器輸入 URL)。 如需詳細資訊,請參閱 類別 HostProtectionAttributeSQL Server程式設計和主機保護屬性

另請參閱

適用於

Sort()

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

public:
 virtual System::ComponentModel::EventDescriptorCollection ^ Sort();
public virtual System.ComponentModel.EventDescriptorCollection Sort ();
abstract member Sort : unit -> System.ComponentModel.EventDescriptorCollection
override this.Sort : unit -> System.ComponentModel.EventDescriptorCollection
Public Overridable Function Sort () As EventDescriptorCollection

傳回

EventDescriptorCollection

新的 EventDescriptorCollection

範例

下列程式碼範例會定義 方法的 Sort 排序次序。 EventDescriptorCollection如果 包含名稱為 、 BCD 的四 EventDescriptor 個 物件 A ,則 的屬性 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"})

備註

注意

HostProtectionAttribute套用至這個類別的屬性具有下列 Resources 屬性值: SynchronizationHostProtectionAttribute 不會影響桌面應用程式 (這些應用程式的啟動方式一般都是按兩下圖示、輸入命令或在瀏覽器輸入 URL)。 如需詳細資訊,請參閱 類別 HostProtectionAttributeSQL Server程式設計和主機保護屬性

適用於

Sort(IComparer)

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

public:
 virtual System::ComponentModel::EventDescriptorCollection ^ Sort(System::Collections::IComparer ^ comparer);
public virtual System.ComponentModel.EventDescriptorCollection Sort (System.Collections.IComparer comparer);
abstract member Sort : System.Collections.IComparer -> System.ComponentModel.EventDescriptorCollection
override this.Sort : System.Collections.IComparer -> System.ComponentModel.EventDescriptorCollection
Public Overridable Function Sort (comparer As IComparer) As EventDescriptorCollection

參數

comparer
IComparer

IComparer,要用於排序這個集合中的 EventDescriptor 物件。

傳回

EventDescriptorCollection

新的 EventDescriptorCollection

範例

下列程式碼範例會定義 方法的 Sort 排序次序。 EventDescriptorCollection如果 包含名稱為 、 BCD 的四 EventDescriptor 個 物件 A ,則 的屬性 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"})

備註

會先套用指定的 IComparer ,後面接著這個集合的預設排序,通常是依字母順序排列。

注意

HostProtectionAttribute套用至這個類別的屬性具有下列 Resources 屬性值: SynchronizationHostProtectionAttribute 不會影響桌面應用程式 (這些應用程式的啟動方式一般都是按兩下圖示、輸入命令或在瀏覽器輸入 URL)。 如需詳細資訊,請參閱 類別 HostProtectionAttributeSQL Server程式設計和主機保護屬性

另請參閱

適用於