public RuntimeSortHierarchyObj(IHierarchyObj outerHierarchy, int depth)
        {
            this.m_hierarchyRoot = outerHierarchy.HierarchyRoot;
            this.m_odpContext    = this.m_hierarchyRoot.Value().OdpContext;
            List <int> sortFilterInfoIndices = this.m_hierarchyRoot.Value().SortFilterInfoIndices;
            int        num = outerHierarchy.ExpressionIndex + 1;

            if (sortFilterInfoIndices == null || num >= sortFilterInfoIndices.Count)
            {
                RuntimeDataTablixGroupRootObjReference runtimeDataTablixGroupRootObjReference = this.m_hierarchyRoot as RuntimeDataTablixGroupRootObjReference;
                if ((BaseReference)null != (object)runtimeDataTablixGroupRootObjReference)
                {
                    using (runtimeDataTablixGroupRootObjReference.PinValue())
                    {
                        RuntimeDataTablixGroupRootObj runtimeDataTablixGroupRootObj = runtimeDataTablixGroupRootObjReference.Value();
                        this.m_dataHolder = (IReference <ISortDataHolder>)runtimeDataTablixGroupRootObj.CreateGroupLeaf();
                        if (!runtimeDataTablixGroupRootObj.HasParent)
                        {
                            runtimeDataTablixGroupRootObj.AddChildWithNoParent((RuntimeGroupLeafObjReference)this.m_dataHolder);
                        }
                    }
                }
                else
                {
                    this.m_dataRowHolder = new RuntimeSortDataHolder();
                }
            }
            else
            {
                this.m_sortHierarchyStruct = new SortHierarchyStructure(this, num, this.m_odpContext.RuntimeSortFilterInfo, sortFilterInfoIndices);
            }
        }
        void IPersistable.Deserialize(IntermediateFormatReader reader)
        {
            reader.RegisterDeclaration(RuntimeSortHierarchyObj.m_declaration);
            IScalabilityCache scalabilityCache = reader.PersistenceHelper as IScalabilityCache;

            while (reader.NextMember())
            {
                switch (reader.CurrentMember.MemberName)
                {
                case MemberName.HierarchyRoot:
                    this.m_hierarchyRoot = (IReference <IHierarchyObj>)reader.ReadRIFObject();
                    break;

                case MemberName.OdpContext:
                {
                    int id = reader.ReadInt32();
                    this.m_odpContext = (OnDemandProcessingContext)scalabilityCache.FetchStaticReference(id);
                    break;
                }

                case MemberName.SortHierarchyStruct:
                    this.m_sortHierarchyStruct = (SortHierarchyStructure)reader.ReadRIFObject();
                    break;

                case MemberName.DataHolder:
                    this.m_dataHolder = (IReference <ISortDataHolder>)reader.ReadRIFObject();
                    break;

                case MemberName.DataRowHolder:
                    this.m_dataRowHolder = (RuntimeSortDataHolder)reader.ReadRIFObject();
                    break;

                default:
                    Global.Tracer.Assert(false);
                    break;
                }
            }
        }