InternalSort() protected method

protected InternalSort ( IComparer sorter ) : void
sorter IComparer
return void
Example #1
0
        public virtual EventDescriptorCollection Sort(IComparer comparer)
        {
            EventDescriptorCollection col = CloneCollection();

            col.InternalSort(comparer);
            return(col);
        }
Example #2
0
        public virtual EventDescriptorCollection Sort(string[] order)
        {
            EventDescriptorCollection col = CloneCollection();

            col.InternalSort(order);
            return(col);
        }
        /// <summary>Sorts the members of this <see cref="T:System.ComponentModel.EventDescriptorCollection" />, given a specified sort order.</summary>
        /// <returns>The new <see cref="T:System.ComponentModel.EventDescriptorCollection" />.</returns>
        /// <param name="names">An array of strings describing the order in which to sort the <see cref="T:System.ComponentModel.EventDescriptor" /> objects in the collection. </param>
        public virtual EventDescriptorCollection Sort(string[] order)
        {
            EventDescriptorCollection eventDescriptorCollection = this.CloneCollection();

            eventDescriptorCollection.InternalSort(order);
            return(eventDescriptorCollection);
        }
        /// <summary>Sorts the members of this <see cref="T:System.ComponentModel.EventDescriptorCollection" />, using the specified <see cref="T:System.Collections.IComparer" />.</summary>
        /// <returns>The new <see cref="T:System.ComponentModel.EventDescriptorCollection" />.</returns>
        /// <param name="comparer">An <see cref="T:System.Collections.IComparer" /> to use to sort the <see cref="T:System.ComponentModel.EventDescriptor" /> objects in this collection. </param>
        public virtual EventDescriptorCollection Sort(IComparer comparer)
        {
            EventDescriptorCollection eventDescriptorCollection = this.CloneCollection();

            eventDescriptorCollection.InternalSort(comparer);
            return(eventDescriptorCollection);
        }
        /// <summary>Sorts the members of this <see cref="T:System.ComponentModel.EventDescriptorCollection" />, using the default sort for this collection, which is usually alphabetical.</summary>
        /// <returns>The new <see cref="T:System.ComponentModel.EventDescriptorCollection" />.</returns>
        public virtual EventDescriptorCollection Sort()
        {
            EventDescriptorCollection eventDescriptorCollection = this.CloneCollection();

            eventDescriptorCollection.InternalSort(null);
            return(eventDescriptorCollection);
        }
        /// <summary>Sorts the members of this <see cref="T:System.ComponentModel.EventDescriptorCollection" />, using the default sort for this collection, which is usually alphabetical.</summary>
        /// <returns>The new <see cref="T:System.ComponentModel.EventDescriptorCollection" />.</returns>
        public virtual EventDescriptorCollection Sort()
        {
            EventDescriptorCollection eventDescriptorCollection = CloneCollection();

            eventDescriptorCollection.InternalSort((IComparer)null);
            return(eventDescriptorCollection);
        }
Example #7
0
        public virtual EventDescriptorCollection Sort(string[] order, IComparer comparer)
        {
            EventDescriptorCollection col = CloneCollection();

            if (order != null)
            {
                ArrayList sorted = col.ExtractItems(order);
                col.InternalSort(comparer);
                sorted.AddRange(col.eventList);
                col.eventList = sorted;
            }
            else
            {
                col.InternalSort(comparer);
            }
            return(col);
        }
        /// <summary>Sorts the members of this <see cref="T:System.ComponentModel.EventDescriptorCollection" />, given a specified sort order and an <see cref="T:System.Collections.IComparer" />.</summary>
        /// <returns>The new <see cref="T:System.ComponentModel.EventDescriptorCollection" />.</returns>
        /// <param name="names">An array of strings describing the order in which to sort the <see cref="T:System.ComponentModel.EventDescriptor" /> objects in the collection. </param>
        /// <param name="comparer">An <see cref="T:System.Collections.IComparer" /> to use to sort the <see cref="T:System.ComponentModel.EventDescriptor" /> objects in this collection. </param>
        public virtual EventDescriptorCollection Sort(string[] order, IComparer comparer)
        {
            EventDescriptorCollection eventDescriptorCollection = this.CloneCollection();

            if (order != null)
            {
                ArrayList arrayList = eventDescriptorCollection.ExtractItems(order);
                eventDescriptorCollection.InternalSort(comparer);
                arrayList.AddRange(eventDescriptorCollection.eventList);
                eventDescriptorCollection.eventList = arrayList;
            }
            else
            {
                eventDescriptorCollection.InternalSort(comparer);
            }
            return(eventDescriptorCollection);
        }