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如果包含四个EventDescriptor具有名称ABCD属性myNewColl的对象,则按顺序A``D``B、和排序。C

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属性值: Synchronization HostProtectionAttribute 不影响桌面应用程序(通常通过双击图标、键入命令或在浏览器中输入 URL 来启动这些应用程序)。 有关详细信息,请参阅HostProtectionAttribute类或SQL 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如果包含四个EventDescriptor具有名称ABCD属性myNewColl的对象,则按顺序A``D``B、和排序。C

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属性值: Synchronization HostProtectionAttribute 不影响桌面应用程序(通常通过双击图标、键入命令或在浏览器中输入 URL 来启动这些应用程序)。 有关详细信息,请参阅HostProtectionAttribute类或SQL 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如果包含四个EventDescriptor具有名称ABCD属性myNewColl的对象,则按顺序A``D``B、和排序。C

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属性值: Synchronization HostProtectionAttribute 不影响桌面应用程序(通常通过双击图标、键入命令或在浏览器中输入 URL 来启动这些应用程序)。 有关详细信息,请参阅HostProtectionAttribute类或SQL 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如果包含四个EventDescriptor具有名称ABCD属性myNewColl的对象,则按顺序A``D``B、和排序。C

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属性值: Synchronization HostProtectionAttribute 不影响桌面应用程序(通常通过双击图标、键入命令或在浏览器中输入 URL 来启动这些应用程序)。 有关详细信息,请参阅HostProtectionAttribute类或SQL Server编程和主机保护属性

另请参阅

适用于