private void button4_Click(object sender, EventArgs e) { if (ActiveMods.SelectedItem != null) { InactiveMods.Items.Add(ActiveMods.SelectedItem); modList.Sort(); var ms = new ModSearch(ActiveMods.SelectedItem.ToString()); int index = modList.FindIndex(ms.StartWith); inactive.Add(modList[index]); active.Remove(modList[index]); ActiveMods.Items.RemoveAt(ActiveMods.SelectedIndex); } }
private void ActiveMods_SelectedIndexChanged(object sender, EventArgs e) { if (ActiveMods.SelectedItem != null) { var ms = new ModSearch(ActiveMods.SelectedItem.ToString()); //finds the index int index = modList.FindIndex(ms.StartWith); //finds the index ModNameLabel.Text = modList[index].name; ModAuthorsLabel.Text = modList[index].author; ModDescriptionLabel.Text = modList[index].description; ModVersionLabel.Text = modList[index].version; ModReleaseDateLabel.Text = modList[index].releaseDate; ModSizeLabel.Text = modList[index].fileSize.ToString() + " KB"; } }