public static AggregateUpdateQueue AggregateOfAggregatesStart(AggregateUpdateContext aggContext, IDataRowHolder scope, DataScopeInfo dataScopeInfo, BucketedDataAggregateObjs aggregatesOfAggregates, AggregateUpdateFlags updateFlags, bool needsSetupEnvironment)
        {
            if (dataScopeInfo == null)
            {
                return(null);
            }
            AggregateUpdateQueue result = null;

            if (aggContext.Mode == AggregateMode.Aggregates)
            {
                if (dataScopeInfo.NeedsSeparateAofAPass)
                {
                    result = aggContext.ReplaceAggregatesToUpdate(aggregatesOfAggregates);
                }
                else
                {
                    result = aggContext.RegisterAggregatesToUpdate(aggregatesOfAggregates);
                    if (updateFlags != 0)
                    {
                        RuntimeDataRegionObj.UpdateAggregatesAtScope(aggContext, scope, dataScopeInfo, updateFlags, needsSetupEnvironment);
                    }
                }
            }
            else if (aggContext.Mode == AggregateMode.PostSortAggregates)
            {
                result = aggContext.RegisterAggregatesToUpdate(aggregatesOfAggregates);
                result = aggContext.RegisterRunningValuesToUpdate(result, dataScopeInfo.RunningValuesOfAggregates);
                if (updateFlags != 0)
                {
                    RuntimeDataRegionObj.UpdateAggregatesAtScope(aggContext, scope, dataScopeInfo, updateFlags, needsSetupEnvironment);
                }
            }
            else
            {
                Global.Tracer.Assert(false, "Unknown AggregateMode for AggregateOfAggregatesStart");
            }
            return(result);
        }
 public static bool HasFlag(AggregateUpdateFlags value, AggregateUpdateFlags flagToTest)
 {
     return((value & flagToTest) != AggregateUpdateFlags.None);
 }
 public static bool UpdateAggregatesAtScope(AggregateUpdateContext aggContext, IDataRowHolder scope, DataScopeInfo scopeInfo, AggregateUpdateFlags updateFlags, bool needsSetupEnvironment)
 {
     return(aggContext.UpdateAggregates(scopeInfo, scope, updateFlags, needsSetupEnvironment));
 }
 public bool UpdateAggregates(DataScopeInfo scopeInfo, IDataRowHolder scopeInst, AggregateUpdateFlags updateFlags, bool needsSetupEnvironment)
 {
     m_aggsForUpdateAtRowScope     = null;
     m_runningValuesForUpdateAtRow = null;
     if (m_activeAggregates == null)
     {
         return(false);
     }
     for (AggregateUpdateCollection aggregateUpdateCollection = m_activeAggregates; aggregateUpdateCollection != null; aggregateUpdateCollection = aggregateUpdateCollection.LinkedCollection)
     {
         if (aggregateUpdateCollection.GetAggregatesForScope(scopeInfo.ScopeID, out List <Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj> aggs))
         {
             if (needsSetupEnvironment)
             {
                 scopeInst.SetupEnvironment();
                 needsSetupEnvironment = false;
             }
             foreach (Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj item in aggs)
             {
                 item.Update();
             }
         }
         if (aggregateUpdateCollection.GetAggregatesForRowScope(scopeInfo.ScopeID, out aggs))
         {
             if (m_aggsForUpdateAtRowScope == null)
             {
                 m_aggsForUpdateAtRowScope = new List <Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj>();
             }
             m_aggsForUpdateAtRowScope.AddRange(aggs);
         }
         if (aggregateUpdateCollection.GetRunningValuesForScope(scopeInfo.ScopeID, out List <string> aggs2))
         {
             if (needsSetupEnvironment)
             {
                 scopeInst.SetupEnvironment();
                 needsSetupEnvironment = false;
             }
             RuntimeDataTablixObj.UpdateRunningValues(m_odpContext, aggs2);
         }
         if (aggregateUpdateCollection.GetRunningValuesForRowScope(scopeInfo.ScopeID, out aggs2))
         {
             if (m_runningValuesForUpdateAtRow == null)
             {
                 m_runningValuesForUpdateAtRow = new List <string>();
             }
             m_runningValuesForUpdateAtRow.AddRange(aggs2);
         }
     }
     if (m_aggsForUpdateAtRowScope != null || m_runningValuesForUpdateAtRow != null)
     {
         if (needsSetupEnvironment)
         {
             scopeInst.SetupEnvironment();
         }
         if (FlagUtils.HasFlag(updateFlags, AggregateUpdateFlags.RowAggregates))
         {
             scopeInst.ReadRows(DataActions.AggregatesOfAggregates, this);
         }
     }
     return(scopeInfo.ScopeID != m_activeAggregates.InnermostUpdateScopeID);
 }