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

            while (reader.NextMember())
            {
                if (reader.CurrentMember.MemberName == MemberName.ID)
                {
                    num = reader.ReadInt64();
                }
                else
                {
                    Global.Tracer.Assert(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);
                this.m_id            = pairObj.First;
                baseScalabilityCache = pairObj.Second;
            }
            else
            {
                this.m_id = new ReferenceID(num);
            }
            this.SetScalabilityCache(baseScalabilityCache);
        }
Example #2
0
        public void Serialize(IntermediateFormatWriter writer)
        {
            this.m_scalabilityCache.ReferenceSerializeCallback(this);
            long value = this.m_id.Value;

            if (!object.ReferenceEquals(writer.PersistenceHelper, this.m_scalabilityCache))
            {
                BaseScalabilityCache baseScalabilityCache        = writer.PersistenceHelper as BaseScalabilityCache;
                PairObj <ReferenceID, BaseScalabilityCache> item = new PairObj <ReferenceID, BaseScalabilityCache>(this.m_id, this.m_scalabilityCache);
                value = baseScalabilityCache.StoreStaticReference(item);
            }
            writer.RegisterDeclaration(BaseReference.m_declaration);
            while (writer.NextMember())
            {
                if (writer.CurrentMember.MemberName == MemberName.ID)
                {
                    writer.Write(value);
                }
                else
                {
                    Global.Tracer.Assert(false);
                }
            }
        }
Example #3
0
 public void Init(BaseScalabilityCache storageManager, ReferenceID id)
 {
     this.SetScalabilityCache(storageManager);
     this.m_id = id;
 }
Example #4
0
 public void Init(BaseScalabilityCache storageManager)
 {
     this.SetScalabilityCache(storageManager);
 }
Example #5
0
 private void SetScalabilityCache(BaseScalabilityCache cache)
 {
     this.m_scalabilityCache = cache;
 }