예제 #1
0
        private void DeleteMods_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("This will uninstall all of your mods and delete everything that's been downloaded.\nYou sure about this?", "Oi", MessageBoxButton.YesNo);

            if (result != MessageBoxResult.Yes)
            {
                return;
            }

            ModManager.silent = true;

            foreach (Mod mod in downloadedModList.collection)
            {
                ModManager.UninstallMod(mod);

                try
                {
                    Directory.Delete(mod.GetDownloadDirectory(), true);
                }
                catch (IOException) { }
            }

            ModManager.silent = false;

            downloadedModList.RefreshCollection();
        }
예제 #2
0
 private void UninstallSelected_Click(object sender, RoutedEventArgs e)
 {
     foreach (Mod mod in DG.SelectedItems)
     {
         ModManager.UninstallMod(mod);
     }
 }
예제 #3
0
 private void CheckBox_Click(object sender, RoutedEventArgs e)
 {
     foreach (Mod mod in DG.SelectedItems)
     {
         if (mod.isInstalled)
         {
             ModManager.UninstallMod(mod);
         }
         else
         {
             ModManager.ActivateMod(mod);
         }
     }
 }