private void optimizeCurrent_Click(object sender, EventArgs e) { if (listBox1.SelectedItem != null) { OptimizeStations op = new OptimizeStations((ListBoxItem)listBox1.SelectedItem); if (plotCheck.Checked == true) { plotGraph(op.getPlotData()); } if (outputCheck.Checked == true) { op.generateOutputFiles(); } } }
private void optimizeAll_Click(object sender, EventArgs e) { if (listBox1.Items.Count > 0) { int counter = 0; ListBoxItem[] items = new ListBoxItem[listBox1.Items.Count]; foreach (var item in listBox1.Items) { ListBoxItem itemBoxed = (ListBoxItem)item; items[counter] = new ListBoxItem(itemBoxed.id, itemBoxed.text); counter += 1; } OptimizeStations op = new OptimizeStations(items); if (plotCheck.Checked == true) { plotGraph(op.getPlotData()); } if (outputCheck.Checked == true) { op.generateOutputFiles(); } } }