Beispiel #1
0
        /// <summary>
        /// Import the last imported savegame.
        /// </summary>
        private void TsbImportLastSaveGame_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Properties.Settings.Default.LastImportedSaveGame))
            {
                MessageBox.Show(
                    "First import a savegame via the menu, after that you can import the last imported file with this button.",
                    "First import manual.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            RunSavegameImport(ATImportFileLocation.CreateFromString(Properties.Settings.Default.LastImportedSaveGame));
        }
        /// <summary>
        /// Import the last imported savegame.
        /// </summary>
        private void TsbImportLastSaveGame_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Properties.Settings.Default.LastImportedSaveGame))
            {
                MessageBoxes.ShowMessageBox(
                    "First import a savegame via the menu. After that you can import the last imported file with this button.",
                    "First import a save file manually", MessageBoxIcon.Information);
                return;
            }

            var importFile = ATImportFileLocation.CreateFromString(Properties.Settings.Default.LastImportedSaveGame);

            if (string.IsNullOrEmpty(importFile.FileLocation) || !File.Exists(importFile.FileLocation))
            {
                MessageBoxes.ShowMessageBox(
                    $"The file that was imported last time does not exist anymore:\n{importFile.FileLocation}\nImport the file you want to import at least once via the menu. After that you can import the last imported file with this button.",
                    "File not existing");
                return;
            }

            RunSavegameImport(importFile);
        }