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

            ApplySortInternal(comparer);
        }
Exemplo 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);
        }
Exemplo 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));
        }