internal override void ReferenceSerializeCallback(BaseReference reference) { ReferenceID id = reference.Id; if (id.IsTemporary) { StorageItem storageItem = (StorageItem)reference.Item; ReferenceID referenceID = m_offsetMap.GenerateId(id); if (id != referenceID) { reference.Id = referenceID; storageItem.Id = referenceID; CacheRemoveValue(id); } CacheSetValue(reference.Id, storageItem); } }
public void Flush(IStorage storage, IIndexStrategy indexStrategy) { bool isTemporary = Id.IsTemporary; if (isTemporary) { Id = indexStrategy.GenerateId(Id); } UnlinkReferences(isTemporary); if (Offset >= 0) { long num = storage.Update(this, Offset, PersistedSize); if (num != Offset) { Offset = num; indexStrategy.Update(Id, Offset); } } else { Offset = storage.Allocate(this); indexStrategy.Update(Id, Offset); } }