public void LoadObj(StorageFormat sf) { StorageDictionary <T> dic = new StorageDictionary <T>(); switch (sf) { case StorageFormat.sfMemory: if (mem != null) { dic = BaseStorageMemory.Load <StorageDictionary <T> >(mem); } break; case StorageFormat.sfText: //if (T is Document) dic = BaseStorageText.LoadObj2(this); break; //XML default: dic = BaseStorageXml.LoadObj(this); break; } this.Clear(); foreach (var elem in dic) { Add(elem.Key, elem.Value); } }
public void SaveObj(StorageFormat sf) { switch (sf) { case StorageFormat.sfMemory: mem = BaseStorageMemory.Save(this); break; case StorageFormat.sfText: //if (T is Document) //BaseStorageDocumentText.SaveObj(this); //break; BaseStorageText.SaveObj2(this); break; //XML default: BaseStorageXml.SaveObj(this); break; } }