Ejemplo n.º 1
0
        protected void InitFilter(Database.Operation.Filter.Filter filter, List <Database.CellPosition> expandedCells = null)
        {
            Database.Operation.Filter.FilterCloning fc = new Database.Operation.Filter.FilterCloning();

            var deffilter = filter.Clone(fc);

            if (deffilter != null)
            {
                m_Filters = new Filter.Multi();

                m_Filters.filters.Add(deffilter);

                m_AllLevelSortFilter = fc.GetFirstUniqueOf <Filter.Sort>();
                if (m_AllLevelSortFilter == null)
                {
                    m_AllLevelSortFilter = new Filter.Sort();
                    var ds = new Database.Operation.Filter.DefaultSort(m_AllLevelSortFilter, null);
                    m_Filters.filters.Add(ds);
                }
                bool bDirty = false;
                m_Filters.Simplify(ref bDirty);
                UpdateDisplayTable(expandedCells);
            }
            else
            {
                InitEmptyFilter(expandedCells);
            }
        }
Ejemplo n.º 2
0
        // return if something change
        public bool AddSubGroupFilter(int colIndex, bool update = true)
        {
            var newFilter = new Filter.GroupByColumnIndex(colIndex, SortOrder.Ascending);


            var ds = new Database.Operation.Filter.DefaultSort(m_AllLevelSortFilter, null);

            var gfp = GetDeepestGroupFilter(m_Filters);

            if (gfp.child != null)
            {
                //add the new group with the default sort filter
                var newMulti = new Filter.Multi();
                newMulti.filters.Add(newFilter);
                newMulti.filters.Add(ds);
                var subf = gfp.child.SubGroupFilter;
                gfp.child.SubGroupFilter = newMulti;
                newFilter.SubGroupFilter = subf;
            }
            else
            {
                //add it to top, already has te default sort filter there
                newFilter.SubGroupFilter = ds;
                m_Filters.filters.Insert(0, newFilter);
            }

            if (update)
            {
                UpdateDisplayTable();
            }
            ReportFilterChanges();
            return(true);
        }
Ejemplo n.º 3
0
        private void InitEmptyFilter(List <Database.CellPosition> expandedCells = null)
        {
            m_Filters = new Filter.Multi();
            var ds = new Database.Operation.Filter.DefaultSort(m_AllLevelSortFilter, null);

            m_Filters.filters.Add(ds);
            UpdateDisplayTable(expandedCells);
        }
Ejemplo n.º 4
0
        public override Filter Clone(FilterCloning fc)
        {
            Multi o = new Multi();

            o.filters.Capacity = filters.Count;
            foreach (var f in filters)
            {
                o.filters.Add(f.Clone(fc));
            }
            return(o);
        }