コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: Elaviers/GCManager
        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);
         }
     }
 }