public static void deleteFile <T>(string xmlFilePath = null) where T : class { if (xmlFilePath == null) { xmlFilePath = StorageIO.getRooDir() + "/" + typeof(T).Name + ".xml"; } StorageIO.deleteFile(xmlFilePath); }
public static bool saveObject <T>(T item, string xmlFilePath = null) where T : class { XmlSeriData <T> dataInfo = new XmlSeriData <T>(item); if (xmlFilePath == null) { xmlFilePath = StorageIO.getRooDir() + "/" + typeof(T).Name + ".xml"; } return(saveToFile <XmlSeriData <T> >(dataInfo, xmlFilePath)); }
public static T loadObject <T>(string xmlFilePath = null) where T : class { if (xmlFilePath == null) { xmlFilePath = StorageIO.getRooDir() + "/" + typeof(T).Name + ".xml"; } XmlSeriData <T> data = loadFromFile <XmlSeriData <T> >(xmlFilePath); if (data != null) { return(data.data); } return(default(T)); }