internal RuntimeRDLDataRegionObj(IReference<IScope> outerScope, Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef, ref DataActions dataAction, OnDemandProcessingContext odpContext, bool onePassProcess, List<Microsoft.ReportingServices.ReportIntermediateFormat.RunningValueInfo> runningValues, Microsoft.ReportingServices.ReportProcessing.ObjectType objectType, int level)
     : base(odpContext, objectType, level)
 {
     m_dataRegionDef = dataRegionDef;
     m_outerScope = outerScope;
     RuntimeDataRegionObj.CreateAggregates(m_odpContext, dataRegionDef.Aggregates, ref m_nonCustomAggregates, ref m_customAggregates);
     if (dataRegionDef.DataScopeInfo != null)
     {
         RuntimeDataRegionObj.CreateAggregates(m_odpContext, dataRegionDef.DataScopeInfo.AggregatesOfAggregates, ref m_aggregatesOfAggregates);
     }
     if (dataRegionDef.Filters != null)
     {
         m_filters = new Filters(Filters.FilterTypes.DataRegionFilter, (IReference<Microsoft.ReportingServices.ReportProcessing.ReportProcessing.IFilterOwner>)base.SelfReference, dataRegionDef.Filters, dataRegionDef.ObjectType, dataRegionDef.Name, m_odpContext, level + 1);
         return;
     }
     m_outerDataAction = dataAction;
     m_dataAction = dataAction;
     dataAction = DataActions.None;
 }
 protected void ConstructorHelper(ref DataActions dataAction, bool onePassProcess, out bool handleMyDataAction, out DataActions innerDataAction)
 {
     innerDataAction    = m_dataAction;
     handleMyDataAction = false;
     if (onePassProcess)
     {
         if (m_dataRegionDef.RunningValues != null && 0 < m_dataRegionDef.RunningValues.Count)
         {
             RuntimeDataRegionObj.CreateAggregates(m_odpContext, m_dataRegionDef.RunningValues, ref m_nonCustomAggregates);
         }
         RuntimeDataRegionObj.CreateAggregates(m_odpContext, m_dataRegionDef.PostSortAggregates, ref m_nonCustomAggregates);
         RuntimeDataRegionObj.CreateAggregates(m_odpContext, m_dataRegionDef.CellPostSortAggregates, ref m_nonCustomAggregates);
     }
     else
     {
         if (m_dataRegionDef.RunningValues != null && 0 < m_dataRegionDef.RunningValues.Count)
         {
             m_dataAction |= DataActions.PostSortAggregates;
         }
         if (m_dataRegionDef.PostSortAggregates != null && m_dataRegionDef.PostSortAggregates.Count != 0)
         {
             RuntimeDataRegionObj.CreateAggregates(m_odpContext, m_dataRegionDef.PostSortAggregates, ref m_postSortAggregates);
             m_dataAction      |= DataActions.PostSortAggregates;
             handleMyDataAction = true;
         }
         if (m_dataRegionDef.DataScopeInfo != null)
         {
             DataScopeInfo dataScopeInfo = m_dataRegionDef.DataScopeInfo;
             if (dataScopeInfo.PostSortAggregatesOfAggregates != null && !dataScopeInfo.PostSortAggregatesOfAggregates.IsEmpty)
             {
                 RuntimeDataRegionObj.CreateAggregates(m_odpContext, dataScopeInfo.PostSortAggregatesOfAggregates, ref m_postSortAggregatesOfAggregates);
             }
             if (dataScopeInfo.HasAggregatesToUpdateAtRowScope)
             {
                 m_dataAction      |= DataActions.AggregatesOfAggregates;
                 handleMyDataAction = true;
             }
         }
         if (handleMyDataAction)
         {
             innerDataAction = DataActions.None;
         }
         else
         {
             innerDataAction = m_dataAction;
         }
     }
     m_inDataRowSortPhase = (m_dataRegionDef.Sorting != null && m_dataRegionDef.Sorting.ShouldApplySorting);
     if (m_inDataRowSortPhase)
     {
         m_sortedDataRowTree     = new BTree(this, m_odpContext, m_depth);
         m_dataRowSortExpression = new RuntimeExpressionInfo(m_dataRegionDef.Sorting.SortExpressions, m_dataRegionDef.Sorting.ExprHost, m_dataRegionDef.Sorting.SortDirections, 0);
         m_odpContext.AddSpecialDataRowSort((IReference <IDataRowSortOwner>)base.SelfReference);
     }
     m_dataRegionDef.ResetInstanceIndexes();
     m_outerGroupingCounters = new int[m_dataRegionDef.OuterGroupingDynamicMemberCount];
     for (int i = 0; i < m_outerGroupingCounters.Length; i++)
     {
         m_outerGroupingCounters[i] = -1;
     }
 }