System.ComponentModel.TypeDescriptor.SortDescriptorArray C# (CSharp) Method

SortDescriptorArray() public static method

Sorts descriptors by name of the descriptor.
public static SortDescriptorArray ( IList infos ) : void
infos IList
return void
        public static void SortDescriptorArray(IList infos)
        {
            if (infos == null)
            {
                throw new ArgumentNullException(nameof(infos));
            }

            ArrayList.Adapter(infos).Sort(MemberDescriptorComparer.Instance);
        }

Usage Example

 /// <summary>
 /// Sorts the members of this PropertyDescriptorCollection using the specified IComparer.
 /// </summary>
 protected void InternalSort(IComparer sorter)
 {
     if (sorter == null)
     {
         TypeDescriptor.SortDescriptorArray(this);
     }
     else
     {
         Array.Sort(_properties, sorter);
     }
 }