Exemple #1
0
        /// <summary>
        /// Deletes a file in the persistant data path.
        /// </summary>
        public static void Persistant(this HUMIO.Data.Delete deleteData, string fileName)
        {
            var path = HUMIO.PersistantPath(fileName);

            if (File.Exists(path))
            {
                File.Delete(path);
            }
        }
Exemple #2
0
        /// <summary>
        /// Copies a file from the persistant data path, into the persistant data path, with a new file name;
        /// </summary>
        public static void Persistant(this HUMIO.Data.Copy copyData, string fileName, string newFileName)
        {
            var path    = HUMIO.PersistantPath(fileName);
            var newPath = HUMIO.PersistantPath(newFileName);

            if (File.Exists(path))
            {
                File.Copy(path, newPath);
            }
        }
Exemple #3
0
        /// <summary>
        /// Sets the save to be in the persistant data path.
        /// </summary>
        public static HUMIO.Data.Persistant Persistant(this HUMIO.Data.Save saveData, string fileName)
        {
            var path = HUMIO.PersistantPath();

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            return(new HUMIO.Data.Persistant(path, saveData, new HUMIO.Data.Load()));
        }