private void checkBoxActive_CheckedChanged(object sender, EventArgs e) { if (listBoxModules.SelectedIndex != -1) { ContainerScoreModuleInfo cont = (ContainerScoreModuleInfo)listBoxModules.SelectedItem; cont.Module.Active = checkBoxActive.Checked; } }
public UserControlRecommendationsSystem(INavReccomendationsSystem navigation, IRecomsSystem adminFunctions) { InitializeComponent(); this.navigation = navigation; this.adminFunctions = adminFunctions; recSys = adminFunctions.getRecomsSystem(); LinkedList <ScoreModuleInfo> modules = recSys.ModulesInfo; foreach (ScoreModuleInfo s in modules) { ContainerScoreModuleInfo cont = new ContainerScoreModuleInfo(s); listBoxModules.Items.Add(cont); } }
private void listBoxModules_SelectedIndexChanged(object sender, EventArgs e) { if (listBoxModules.SelectedIndex != -1) { ContainerScoreModuleInfo cont = (ContainerScoreModuleInfo)listBoxModules.SelectedItem; listBoxSubmultiplicators.Items.Clear(); ScoreModuleInfo module = cont.Module; foreach (SubMultiplicator s in module.SubMultiplicators) { listBoxSubmultiplicators.Items.Add(s); } textBoxMain.Text = module.MainMultiplicator.ToString(); checkBoxActive.Checked = module.Active; } }
private void buttonSetMain_Click(object sender, EventArgs e) { try { int val = Convert.ToInt32(textBoxMain.Text); if (val <= 0) { MessageBox.Show("Main multiplicator value must be greater than 0"); return; } if (listBoxModules.SelectedIndex != -1) { ContainerScoreModuleInfo cont = (ContainerScoreModuleInfo)listBoxModules.SelectedItem; cont.Module.MainMultiplicator = val; } } catch (Exception) { MessageBox.Show("Incorrect data"); } }