Beispiel #1
0
        public void PerformSave(InventorySaveData data)
        {
            var stream = new FileStream(data.Targetname, FileMode.Create);

            stream.Write(data.Data, 0, data.Data.Length);
            stream.Close();
            stream.Dispose();
        }
Beispiel #2
0
        public void SaveInventory(Inventory item)
        {
            if (!item.KeepPersisted)
            {
                return;
            }

            var data = new InventorySaveData
            {
                Data       = GetInventoryData(item),
                Targetname = GetFileForInventory(item.Id)
            };

            lock (this)
            {
                _saveInventories[item.Id] = data;
            }
        }