private void listOfMapsToPatchIn_SelectedIndexChanged(object sender, EventArgs e) { if (listOfMapsToPatchIn.SelectedItems.Count >= 2) { addMapButton.Text = "Set Dynamic"; } else { addMapButton.Text = "Add map"; dynamicMapPanel.Visible = false; MapSelectionRadioButtonHelpers.SetAllMapButtonsActive(); var allSelectedItems = this.listOfMapsToPatchIn.SelectedItems; var mapToPatch = ""; foreach (ListViewItem item in allSelectedItems) { mapToPatch = item.SubItems[1].Text; whichMapShouldWeReplaceLabel.Text = "Which map should " + item.SubItems[0].Text + " replace?"; } MapSelectionRadioButtonHelpers.CheckMap(mapToPatch); //see which map we're on and check the correct radio button foreach (ListViewItem item in listOfMapsToPatchIn.Items) { var mapName = item.SubItems[1].Text; MapSelectionRadioButtonHelpers.CheckAndDisableMapButton(mapName); } } }
private void clearListButton_Click(object sender, EventArgs e) { listOfMapsToPatchIn.Items.Clear(); noneButton.Checked = true; whichMapShouldWeReplaceLabel.Text = "Which map should we replace?"; MapSelectionRadioButtonHelpers.SetAllMapButtonsActive(); addMapButton.Text = "Add map"; }
private void RemoveMapFromList(object sender, EventArgs e) { var indexes = listOfMapsToPatchIn.SelectedIndices; for (var i = (listOfMapsToPatchIn.Items.Count - 1); i >= 0; i--) { if (!indexes.Contains(i)) { continue; } listOfMapsToPatchIn.Items.RemoveAt(i); } whichMapShouldWeReplaceLabel.Text = "Which map should we replace?"; noneButton.Checked = true; addMapButton.Text = "Add map"; MapSelectionRadioButtonHelpers.SetAllMapButtonsActive(); foreach (ListViewItem item in listOfMapsToPatchIn.Items) { var mapName = item.SubItems[1].Text; MapSelectionRadioButtonHelpers.CheckAndDisableMapButton(mapName); } }