private void Traverse(ProcessingStages operation, AggregateUpdateContext aggContext) { if (m_grouping != null) { m_grouping.Traverse(ProcessingStages.SortAndFilter, ascending: true, aggContext); } if (m_hierarchyObjs == null) { return; } for (int i = 0; i < m_hierarchyObjs.Count; i++) { IReference <RuntimeHierarchyObj> reference = m_hierarchyObjs[i]; using (reference.PinValue()) { switch (operation) { case ProcessingStages.SortAndFilter: reference.Value().SortAndFilter(aggContext); break; case ProcessingStages.UpdateAggregates: reference.Value().UpdateAggregates(aggContext); break; } } } }
internal override bool SortAndFilter(AggregateUpdateContext aggContext) { if (m_odpContext.HasSecondPassOperation(SecondPassOperations.FilteringOrAggregatesOrDomainScope)) { CopyDomainScopeGroupInstancesFromTarget(); } RuntimeGroupingObj grouping = m_grouping; bool ascending = DetermineTraversalDirection(); bool result = true; bool processSecondPassSorting = ProcessSecondPassSorting; bool flag = (SecondPassOperations.FilteringOrAggregatesOrDomainScope & m_odpContext.SecondPassOperation) != 0 && (m_hierarchyDef.HasFilters || m_hierarchyDef.HasInnerFilters); if (processSecondPassSorting) { m_expression = new RuntimeExpressionInfo(m_hierarchyDef.Sorting.SortExpressions, m_hierarchyDef.Sorting.ExprHost, m_hierarchyDef.Sorting.SortDirections, 0); m_groupingType = RuntimeGroupingObj.GroupingTypes.Sort; m_grouping = new RuntimeGroupingObjTree(this, m_objectType); } else if (flag) { m_groupingType = RuntimeGroupingObj.GroupingTypes.None; m_grouping = new RuntimeGroupingObjLinkedList(this, m_objectType); } if (flag) { m_groupFilters = new Filters(Filters.FilterTypes.GroupFilter, (IReference <Microsoft.ReportingServices.ReportProcessing.ReportProcessing.IFilterOwner>)base.SelfReference, m_hierarchyDef.Grouping.Filters, Microsoft.ReportingServices.ReportProcessing.ObjectType.Grouping, m_hierarchyDef.Grouping.Name, m_odpContext, base.Depth + 1); } m_processingStage = ProcessingStages.SortAndFilter; m_lastChild = null; grouping.Traverse(ProcessingStages.SortAndFilter, ascending, aggContext); if (flag) { m_groupFilters.FinishReadingGroups(aggContext); if (!processSecondPassSorting && null == m_lastChild) { if (m_firstChild != null) { m_firstChild.Free(); } m_firstChild = null; result = false; } } if (grouping != m_grouping) { grouping.Cleanup(); } return(result); }