/// <summary> /// Remove mods from profile /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void removeModButton_Click(object sender, EventArgs e) { var grid = profileModsGrid; App.FactorioLoader.Profiles.CurrentProfile.RemoveMods( FormControlHelper.GetModsFromGridSelection(grid)); App.FactorioLoader.Profiles.CurrentProfile.Save(); UpdateAllModData(); }
/// <summary> /// When a grid selection changes then deselect all the other grids so /// only a single grid has selections. /// Also update the current Mod data /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ChangeGridSelection(object sender, EventArgs e) { var grid = (MetroGrid)sender; if (grid.SelectedRows.Count <= 0) { UpdateCurrentModDescription(); return; } ; //Clear all other grid selections foreach (var g in AllGrids) { if (grid.Equals(g)) { continue; } g.ClearSelection(); } UpdateCurrentModDescription(FormControlHelper.GetModsFromGridSelection(grid)); }