Esempio n. 1
0
 private void UpdateNodesAndSlostWithResolveMissingSlotAfterAction(IStorage storage, List<IVisualNode> nodeList, List<uint> slotIdList)
 {
     DataHeader header = new DataHeader();
     storage.Seek(12, SeekOrigin.Current); //By-pass the reading of total number of slots stored
     foreach (uint slotId in slotIdList)
     {
         header.Deserialize(storage);
         if (this.graphController.ContainSlotKey(slotId))
         {
             ISlot slot = this.graphController.GetSlot(slotId);
             slot.Deserialize(storage);
         }
         else
         {
             ISlot slot = Slot.Create(this.graphController, storage);
             this.graphController.AddSlot(slot);
         }
     }
     storage.Seek(12, SeekOrigin.Current); //By-pass the reading of total number of nodes stored
     foreach (IVisualNode node in nodeList)
     {
         header.Deserialize(storage);
         node.Deserialize(storage);
     }
 }
Esempio n. 2
0
 private List<ISlot> RetrieveSlotsFromStorage(IStorage storage)
 {
     DataHeader header = new DataHeader();
     List<ISlot> slotList = new List<ISlot>();
     int slotCount = storage.ReadInteger(FieldCode.SlotCount);
     for (int i = 0; i < slotCount; i++)
     {
         header.Deserialize(storage);
         ISlot slot = Slot.Create(this.graphController, storage);
         slotList.Add(slot);
     }
     return slotList;
 }