private void InstallationTargets_ComboBox_SelectedItemChanged(object sender, SelectionChangedEventArgs e)
        {
            DLCModsInstalled.ClearEx();

            //Get installed mod information
            if (e.AddedItems.Count > 0)
            {
                SelectedTarget = e.AddedItems[0] as GameTarget;
                PopulateUI();
                var backupLoc = Utilities.GetGameBackupPath(SelectedTarget.Game);
                if (backupLoc != null)
                {
                    BackupLocationString = "Backup at " + backupLoc;
                }
                else
                {
                    BackupLocationString = "No backup for this game";
                }
            }
            else
            {
                SelectedTarget       = null;
                BackupLocationString = null;
            }
        }
        public void OnSelectedTargetChanged()
        {
            if (PreviousTarget != null)
            {
                PreviousTarget.ModifiedBasegameFilesView.Filter = null;
            }
            DLCModsInstalled.ClearEx();

            //Get installed mod information
            if (SelectedTarget != null)
            {
                PopulateUI();
                var backupLoc = Utilities.GetGameBackupPath(SelectedTarget.Game);
                if (backupLoc != null)
                {
                    BackupLocationString = M3L.GetString(M3L.string_interp_backupAtX, backupLoc);
                }
                else
                {
                    BackupLocationString = M3L.GetString(M3L.string_noBackupForThisGame);
                }

                SelectedTarget.ModifiedBasegameFilesView.Filter = FilterBasegameObject;
            }
            else
            {
                BackupLocationString = null;
            }

            PreviousTarget = SelectedTarget;
        }
Exemplo n.º 3
0
        private void InstallationTargets_ComboBox_SelectedItemChanged(object sender, SelectionChangedEventArgs e)
        {
            DLCModsInstalled.ClearEx();

            //Get installed mod information
            if (e.AddedItems.Count > 0)
            {
                SelectedTarget = e.AddedItems[0] as GameTarget;
                PopulateUI();
                var backupLoc = Utilities.GetGameBackupPath(SelectedTarget.Game);
                if (backupLoc != null)
                {
                    BackupLocationString = M3L.GetString(M3L.string_interp_backupAtX, backupLoc);
                }
                else
                {
                    BackupLocationString = M3L.GetString(M3L.string_noBackupForThisGame);
                }
            }
            else
            {
                SelectedTarget       = null;
                BackupLocationString = null;
            }
        }
        public void OnSelectedTargetChanged()
        {
            if (PreviousTarget != null)
            {
                PreviousTarget.ModifiedBasegameFilesView.Filter = null;
            }
            DLCModsInstalled.ClearEx();

            //Get installed mod information
            //NamedBackgroundWorker nbw = new NamedBackgroundWorker(@"InstallationInformationDataPopulator");
            //nbw.DoWork += (a, b) =>
            //{
            if (SelectedTarget != null)
            {
                PopulateUI();
                var backupLoc = BackupService.GetGameBackupPath(SelectedTarget.Game);
                if (backupLoc != null)
                {
                    BackupLocationString = M3L.GetString(M3L.string_interp_backupAtX, backupLoc);
                }
                else
                {
                    BackupLocationString = M3L.GetString(M3L.string_noBackupForThisGame);
                }

                SelectedTarget.ModifiedBasegameFilesView.Filter = FilterBasegameObject;
            }
            else
            {
                BackupLocationString = null;
            }
            //};
            //nbw.RunWorkerCompleted += (await, b) =>
            //{
            //    if (b.Error != null)
            //    {
            //        Log.Error($@"Error in installation information data populator: {b.Error.Message}");
            //    }
            //};
            //nbw.RunWorkerAsync();
            PreviousTarget = SelectedTarget;
        }