IDisposable IMemberHierarchy.AddMemberInstance(DataRegionMemberInstance instance, int indexInCollection, IScalabilityCache cache, out int instanceIndex)
        {
            List <ScalableList <DataRegionMemberInstance> > list = instance.MemberDef.IsColumn ? m_columnMembers : m_rowMembers;
            bool flag = false;

            if (list == null)
            {
                flag = true;
                list = new List <ScalableList <DataRegionMemberInstance> >();
                if (instance.MemberDef.IsColumn)
                {
                    m_columnMembers = list;
                }
                else
                {
                    m_rowMembers = list;
                }
            }
            ListUtils.AdjustLength(list, indexInCollection);
            ScalableList <DataRegionMemberInstance> scalableList = list[indexInCollection];

            if (flag || scalableList == null)
            {
                scalableList = (list[indexInCollection] = new ScalableList <DataRegionMemberInstance>(0, cache, 100, 5));
            }
            instanceIndex = scalableList.Count;
            return(scalableList.AddAndPin(instance));
        }
        internal static DataRegionMemberInstance CreateInstance(IMemberHierarchy parentInstance, OnDemandProcessingContext odpContext, ReportHierarchyNode memberDef, long firstRowOffset, int memberInstanceIndexWithinScopeLevel, int recursiveLevel, List <object> groupExpressionValues, object[] groupVariableValues, out int instanceIndex)
        {
            DataRegionMemberInstance dataRegionMemberInstance = new DataRegionMemberInstance(odpContext, memberDef, firstRowOffset, memberInstanceIndexWithinScopeLevel, recursiveLevel, groupExpressionValues, groupVariableValues);

            dataRegionMemberInstance.m_cleanupRef = parentInstance.AddMemberInstance(dataRegionMemberInstance, memberDef.IndexInCollection, odpContext.OdpMetadata.GroupTreeScalabilityCache, out instanceIndex);
            return(dataRegionMemberInstance);
        }
        IDisposable IMemberHierarchy.AddMemberInstance(DataRegionMemberInstance instance, int indexInCollection, IScalabilityCache cache, out int instanceIndex)
        {
            bool flag = false;

            if (m_children == null)
            {
                m_children = new List <ScalableList <DataRegionMemberInstance> >();
                flag       = true;
            }
            ListUtils.AdjustLength(m_children, indexInCollection);
            ScalableList <DataRegionMemberInstance> scalableList = m_children[indexInCollection];

            if (flag || scalableList == null)
            {
                scalableList = new ScalableList <DataRegionMemberInstance>(0, cache, 100, 5);
                m_children[indexInCollection] = scalableList;
            }
            instanceIndex = scalableList.Count;
            return(scalableList.AddAndPin(instance));
        }
        private static void TraceDataRegionMemberInstance(DataRegionMemberInstance instance, int level)
        {
            Global.Tracer.Assert(instance != null, "(null != instance)");
            string emptyString = GetEmptyString(level);

            Global.Tracer.Trace("{0}DataRegionMemberInstance={1}, [id={2}], Index={3}, RecursiveLevel={4}", emptyString, instance.MemberDef.Grouping.Name, instance.MemberDef.ID, instance.MemberInstanceIndexWithinScopeLevel, instance.RecursiveLevel);
            if (instance.GroupVariables != null)
            {
                Global.Tracer.Trace("{0}Group Variables={1}", emptyString, FlattenObjectArray(instance.GroupVariables));
            }
            if (instance.GroupExprValues != null)
            {
                Global.Tracer.Trace("{0}Group Expr.Vals={1}", emptyString, FlattenObjectArray(instance.GroupExprValues));
            }
            TraceScopeInstance(instance, level + 1);
            TraceCellInstances(instance.Cells, level + 1);
            if (instance.Children != null && instance.Children.Count != 0)
            {
                TraceDataRegionMemberInstances(instance.Children, level + 1);
            }
        }