示例#1
0
        protected override void ApplySortCore(PropertyDescriptor property,
                                              ListSortDirection direction)
        {
            m_SortDirection = direction;
            m_SortProperty  = property;
            SortComparer <T> comparer =
                new SortComparer <T>(property, direction);

            ApplySortInternal(comparer);
        }
示例#2
0
        private void ApplySortInternal(SortComparer <T> comparer)
        {
            if (m_OriginalCollection.Count == 0)
            {
                m_OriginalCollection.AddRange(this);
            }
            List <T> listRef = this.Items as List <T>;

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