private void insertStation(String name, int id) { TbStation s = new TbStation(); s.id = id; s.Name = name; stationPool = stationPool.Concat(new TbStation[] { s }).ToArray(); }
private void button2_Click(object sender, EventArgs e) { //when user add a station to be considered in prim's algorithm check wether the station //is elegible to be added.. TbStation selectedItem = ((TbStation)selectedStationCombo.SelectedItem); String errMsg; if ((errMsg = checkIfValid(selectedItem.id)) != null)//iif error message is null it means successfully //station is selected { popInvalidSelectionError(errMsg); } else { selectedStationContainer.Items.Add(selectedItem.Name); } }