private void analyzeMenuItem_Click(object sender, System.EventArgs e)
        {
            SaveBackup saveBackup = (SaveBackup)dataBackups.SelectedItem;

            logMessage("Showing backup save (" + saveBackup.Name + ") world analyzer...");
            SaveAnalyzer analyzer = new SaveAnalyzer(this);

            analyzer.Title    = "Backup Save (" + saveBackup.Name + ") World Analyzer";
            analyzer.Closing += Backup_Analyzer_Closing;
            List <RemnantCharacter> chars = saveBackup.Save.Characters;

            for (int i = 0; i < chars.Count; i++)
            {
                chars[i].LoadWorldData(i);
            }
            analyzer.LoadData(chars);
            backupSaveAnalyzers.Add(analyzer);
            analyzer.Show();
        }
        public MainWindow()
        {
            InitializeComponent();
            suppressLog = false;
            txtLog.Text = "Version " + typeof(MainWindow).Assembly.GetName().Version;
            if (Properties.Settings.Default.CreateLogFile)
            {
                System.IO.File.WriteAllText("log.txt", DateTime.Now.ToString() + ": Version " + typeof(MainWindow).Assembly.GetName().Version + "\r\n");
            }
            logMessage("Loading...");
            if (Properties.Settings.Default.UpgradeRequired)
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.UpgradeRequired = false;
                Properties.Settings.Default.Save();
            }

            if (Properties.Settings.Default.BackupFolder.Length == 0)
            {
                logMessage("Backup folder not set; reverting to default.");
                Properties.Settings.Default.BackupFolder = defaultBackupFolder;
                Properties.Settings.Default.Save();
            }
            else if (!Directory.Exists(Properties.Settings.Default.BackupFolder) && !Properties.Settings.Default.BackupFolder.Equals(defaultBackupFolder))
            {
                logMessage("Backup folder (" + Properties.Settings.Default.BackupFolder + ") not found; reverting to default.");
                Properties.Settings.Default.BackupFolder = defaultBackupFolder;
                Properties.Settings.Default.Save();
            }
            backupDirPath        = Properties.Settings.Default.BackupFolder;
            txtBackupFolder.Text = backupDirPath;

            chkCreateLogFile.IsChecked = Properties.Settings.Default.CreateLogFile;

            saveTimer           = new System.Timers.Timer();
            saveTimer.Interval  = 2000;
            saveTimer.AutoReset = false;
            saveTimer.Elapsed  += OnSaveTimerElapsed;

            saveWatcher      = new FileSystemWatcher();
            saveWatcher.Path = saveDirPath;

            // Watch for changes in LastWrite times.
            saveWatcher.NotifyFilter = NotifyFilters.LastWrite;

            // Only watch sav files.
            saveWatcher.Filter = "profile.sav";

            // Add event handlers.
            saveWatcher.Changed += OnSaveFileChanged;
            saveWatcher.Created += OnSaveFileChanged;
            saveWatcher.Deleted += OnSaveFileChanged;
            //watcher.Renamed += OnRenamed;

            listBackups = new List <SaveBackup>();

            ((MenuItem)dataBackups.ContextMenu.Items[1]).Click += deleteMenuItem_Click;

            activeSaveAnalyzer = new SaveAnalyzer(this)
            {
                ActiveSave = true,
                Title      = "Active Save World Analyzer"
            };
            backupSaveAnalyzers = new List <SaveAnalyzer>();

            ((MenuItem)dataBackups.ContextMenu.Items[0]).Click += analyzeMenuItem_Click;

            GameInfo.GameInfoUpdate      += OnGameInfoUpdate;
            dataBackups.CanUserDeleteRows = false;
            saveCount = 0;
        }