Esempio n. 1
0
        // This is the code to delete a backup
        public static void DeleteSave(Save save)
        {
            //Create new list
            List <Save> saveList = new List <Save>();

            // Gets the contents of the data file and push on the list
            saveList = SaveList.ImportSaveList();

            int position = SeachIndex(saveList, save);

            saveList.RemoveAt(position);
            ExportList(saveList);
        }
Esempio n. 2
0
        public static bool SearchNameExist(string name)
        {
            bool        IsExist  = false;
            List <Save> saveList = new List <Save>();

            // Gets the contents of the data file and push on the list
            saveList = SaveList.ImportSaveList();

            for (int i = 0; i < saveList.Count; i++)
            {
                if (saveList[i].name != name)
                {
                    IsExist = false;
                }
                else if (saveList[i].name == name)
                {
                    IsExist = true;
                }
            }
            return(IsExist);
        }