Example #1
0
        public GameBackup getGameBackup()
        {
            GameBackup gameBackup = new GameBackup(txtGameName.Text);

            if (txtBackupFolder.Text != null && !txtBackupFolder.Text.Equals(""))
            {
                gameBackup.BackupFolder = txtBackupFolder.Text;
            }
            LinkedList <string> saves = new LinkedList <string>();

            foreach (ListViewItem item in listSavesFolders.Items)
            {
                saves.AddLast(item.Text);
            }
            if (saves != null && saves.Count > 0)
            {
                gameBackup.SavesFolders = saves;
            }
            LinkedList <string> opts = new LinkedList <string>();

            foreach (ListViewItem item in listOptionsFiles.Items)
            {
                opts.AddLast(item.Text);
            }
            if (opts != null && opts.Count > 0)
            {
                gameBackup.OptionsFiles = opts;
            }
            return(gameBackup);
        }
Example #2
0
 private void workerLoadXmlFile_DoWork(object sender, DoWorkEventArgs e)
 {
     workerLoadXmlFile.ReportProgress(0);
     document.Load(fileName);
     gameBackupList = GameBackup.ImportXMLToList(document);
     workerLoadXmlFile.ReportProgress(100);
 }
Example #3
0
 private void workerSaveXmlFile_DoWork(object sender, DoWorkEventArgs e)
 {
     workerSaveXmlFile.ReportProgress(0);
     document = GameBackup.ExportListToXML(gameBackupList);
     workerSaveXmlFile.ReportProgress(50);
     document.Save(fileName);
     workerSaveXmlFile.ReportProgress(100);
 }
Example #4
0
        public void SetGameBackup(GameBackup gameBackup)
        {
            txtGameName.Text     = gameBackup.GameName;
            txtBackupFolder.Text = gameBackup.BackupFolder;

            listSavesFolders.Items.Clear();
            foreach (string folder in gameBackup.SavesFolders)
            {
                listSavesFolders.Items.Add(folder);
            }

            listOptionsFiles.Items.Clear();
            foreach (string option in gameBackup.OptionsFiles)
            {
                listOptionsFiles.Items.Add(option);
            }
            checkSavesFoldersExist();
            checkOptionsFilesExist();
        }
Example #5
0
 public void SetGameBackup(GameBackup gameBackup)
 {
     ucGameBackup1.SetGameBackup(gameBackup);
 }