Esempio n. 1
0
        void IBindingListView.ApplySort(ListSortDescriptionCollection sorts)
        {
            m_SortProperty     = null;
            m_SortDescriptions = sorts;
            SortComparer <T> comparer = new SortComparer <T>(sorts);

            ApplySortInternal(comparer);
        }
Esempio n. 2
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);
        }
Esempio n. 3
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));
        }