Exemplo n.º 1
0
        public void ApplySort(ListSortDescriptionCollection
                              sortCollection)
        {
            bool oldRaise = RaiseListChangedEvents;

            RaiseListChangedEvents = false;
            try
            {
                PropertyComparerCollection <T> tmp
                    = new PropertyComparerCollection <T>(sortCollection);
                List <T> items = new List <T>(this);
                items.Sort(tmp);
                int index = 0;
                foreach (T item in items)
                {
                    SetItem(index++, item);
                }
                this.sorts = tmp;
            }
            finally
            {
                RaiseListChangedEvents = oldRaise;
                ResetBindings();
            }
        }
Exemplo n.º 2
0
 protected override void RemoveSortCore()
 {
     this.sorts = null;
 }