TypeConverter.SortProperties(PropertyDescriptorCollection, String[]) Method

Definition

Sorts a collection of properties.

protected System.ComponentModel.PropertyDescriptorCollection SortProperties(System.ComponentModel.PropertyDescriptorCollection props, string[] names);

Parameters

props
PropertyDescriptorCollection

A PropertyDescriptorCollection that has the properties to sort.

names
String[]

An array of names in the order you want the properties to appear in the collection.

Returns

A PropertyDescriptorCollection that contains the sorted properties.

Remarks

All properties in the collection that are not already in the array of names are added alphabetically to the end. If the names parameter is an empty array or null, all the properties in the collection are sorted alphabetically.

Applies to

Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also