EventDescriptorCollection::Sort Method (array<String^>^, IComparer^)
Sorts the members of this EventDescriptorCollection, given a specified sort order and an IComparer.
Assembly: System (in System.dll)
public: virtual EventDescriptorCollection^ Sort( array<String^>^ names, IComparer^ comparer )
Parameters
- names
-
Type:
array<System::String^>^
An array of strings describing the order in which to sort the EventDescriptor objects in the collection.
- comparer
-
Type:
System.Collections::IComparer^
An IComparer to use to sort the EventDescriptor objects in this collection.
Return Value
Type: System.ComponentModel::EventDescriptorCollection^The new EventDescriptorCollection.
The specified sort order is applied first, followed by the sort using the specified IComparer.
Note |
|---|
The HostProtectionAttribute attribute applied to this class has the following Resources property value: Synchronization. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes. |
The following code example defines the sort order for the Sort method. If the EventDescriptorCollection contains four EventDescriptor objects with the names A, B, C, and D, the properties of myNewColl would be sorted in the order D, B, A, and C.
Available since 1.1
