예제 #1
0
 public static void deleteFile <T>(string xmlFilePath = null) where T : class
 {
     if (xmlFilePath == null)
     {
         xmlFilePath = StorageIO.getRooDir() + "/" + typeof(T).Name + ".xml";
     }
     StorageIO.deleteFile(xmlFilePath);
 }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }