public void Deserialize(IntermediateFormatReader reader)
        {
            reader.RegisterDeclaration(m_declaration);
            long num = 0L;

            while (reader.NextMember())
            {
                if (reader.CurrentMember.MemberName == MemberName.ID)
                {
                    num = reader.ReadInt64();
                }
                else
                {
                    Global.Tracer.Assert(condition: false);
                }
            }
            BaseScalabilityCache baseScalabilityCache = reader.PersistenceHelper as BaseScalabilityCache;
            ScalabilityCacheType cacheType            = baseScalabilityCache.CacheType;

            if (num < 0 && cacheType != ScalabilityCacheType.GroupTree && cacheType != ScalabilityCacheType.Lookup)
            {
                PairObj <ReferenceID, BaseScalabilityCache> pairObj = (PairObj <ReferenceID, BaseScalabilityCache>)baseScalabilityCache.FetchStaticReference((int)num);
                m_id = pairObj.First;
                baseScalabilityCache = pairObj.Second;
            }
            else
            {
                m_id = new ReferenceID(num);
            }
            SetScalabilityCache(baseScalabilityCache);
        }
        public void Serialize(IntermediateFormatWriter writer)
        {
            m_scalabilityCache.ReferenceSerializeCallback(this);
            long value = m_id.Value;

            if (writer.PersistenceHelper != m_scalabilityCache)
            {
                BaseScalabilityCache obj = writer.PersistenceHelper as BaseScalabilityCache;
                PairObj <ReferenceID, BaseScalabilityCache> item = new PairObj <ReferenceID, BaseScalabilityCache>(m_id, m_scalabilityCache);
                value = obj.StoreStaticReference(item);
            }
            writer.RegisterDeclaration(m_declaration);
            while (writer.NextMember())
            {
                if (writer.CurrentMember.MemberName == MemberName.ID)
                {
                    writer.Write(value);
                }
                else
                {
                    Global.Tracer.Assert(condition: false);
                }
            }
        }
 internal void Init(BaseScalabilityCache storageManager, ReferenceID id)
 {
     SetScalabilityCache(storageManager);
     m_id = id;
 }
 internal void Init(BaseScalabilityCache storageManager)
 {
     SetScalabilityCache(storageManager);
 }
 private void SetScalabilityCache(BaseScalabilityCache cache)
 {
     m_scalabilityCache = cache;
 }