Пример #1
0
        protected override void ApplySortCore(PropertyDescriptor prop, ListSortDirection direction)
        {
            mSortDirection = direction;
            mSortProperty  = prop;
            BaseEntitySortComparer <T> comparer = new BaseEntitySortComparer <T>(prop, direction);

            ApplySortInternal(comparer);
        }
Пример #2
0
        private void ApplySortInternal(BaseEntitySortComparer <T> comparer)
        {
            if (mOriginalCollection.Count == 0)
            {
                mOriginalCollection.AddRange(this);
            }
            List <T> listRef = this.Items as List <T>;

            if (listRef == null)
            {
                return;
            }
            listRef.Sort(comparer);
            mSorted = true;
            OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
        }