コード例 #1
0
        internal IntList GetPeerSortFilters(bool create)
        {
            if (m_userSort == null)
            {
                return(null);
            }
            InScopeSortFilterHashtable inScopeSortFilterHashtable = null;
            IntList intList = null;

            if (m_containingScopes == null || m_containingScopes.Count == 0 || m_isSubReportTopLevelScope)
            {
                inScopeSortFilterHashtable = GetSortFiltersInScope(create, inDetail: false);
            }
            else
            {
                Grouping lastEntry = m_containingScopes.LastEntry;
                if (lastEntry == null)
                {
                    inScopeSortFilterHashtable = GetSortFiltersInScope(create, inDetail: true);
                }
                else if (m_userSort.SortExpressionScope == null)
                {
                    if (lastEntry.DetailSortFiltersInScope == null && create)
                    {
                        lastEntry.DetailSortFiltersInScope = new InScopeSortFilterHashtable();
                    }
                    inScopeSortFilterHashtable = lastEntry.DetailSortFiltersInScope;
                }
                else
                {
                    if (lastEntry.NonDetailSortFiltersInScope == null && create)
                    {
                        lastEntry.NonDetailSortFiltersInScope = new InScopeSortFilterHashtable();
                    }
                    inScopeSortFilterHashtable = lastEntry.NonDetailSortFiltersInScope;
                }
            }
            if (inScopeSortFilterHashtable != null)
            {
                int num = (m_userSort.SortExpressionScope == null) ? m_userSort.SortTarget.ID : m_userSort.SortExpressionScope.ID;
                intList = inScopeSortFilterHashtable[num];
                if (intList == null && create)
                {
                    intList = new IntList();
                    inScopeSortFilterHashtable.Add(num, intList);
                }
            }
            return(intList);
        }
コード例 #2
0
        private InScopeSortFilterHashtable GetSortFiltersInScope(bool create, bool inDetail)
        {
            InScopeSortFilterHashtable inScopeSortFilterHashtable = null;
            ReportItem parent = m_parent;

            if (inDetail)
            {
                while (parent != null && !(parent is DataRegion))
                {
                    parent = parent.Parent;
                }
            }
            else
            {
                while (parent != null && !(parent is Report))
                {
                    parent = parent.Parent;
                }
            }
            Global.Tracer.Assert(parent is DataRegion || parent is Report);
            if (parent is Report)
            {
                Report report = (Report)parent;
                if (m_userSort.SortExpressionScope == null)
                {
                    if (report.DetailSortFiltersInScope == null && create)
                    {
                        report.DetailSortFiltersInScope = new InScopeSortFilterHashtable();
                    }
                    return(report.DetailSortFiltersInScope);
                }
                if (report.NonDetailSortFiltersInScope == null && create)
                {
                    report.NonDetailSortFiltersInScope = new InScopeSortFilterHashtable();
                }
                return(report.NonDetailSortFiltersInScope);
            }
            Global.Tracer.Assert(m_userSort.SortExpressionScope == null);
            DataRegion dataRegion = (DataRegion)parent;

            if (dataRegion.DetailSortFiltersInScope == null && create)
            {
                dataRegion.DetailSortFiltersInScope = new InScopeSortFilterHashtable();
            }
            return(dataRegion.DetailSortFiltersInScope);
        }