private void conectar_Click(object sender, EventArgs e) { String conexion = conex.Text.ToString(); String conexionURL = "http://" + conexion + "/EstacionMaster/services/Estacion?wsdl"; Estacion.EstacionService estacion = new Estacion.EstacionService(); try { estacion.Url = conexionURL; int numEstacion = estaciones.Keys.Count(); String estacionText = "station" + numEstacion + " -> " + conexion; String estacionNombre = "station" + estaciones.Count; if (!estaciones.ContainsKey(estacionText)) { stationList.Items.Add(estacionNombre); stations.Items.Add(estacionText); estaciones.Add(estacionNombre, estacion); //estacionActual = estacion; } else { error(error_estacion_existente); } } catch (Exception ex) { error(error_conexion); } }
private void estacionSeleccionada(object sender, EventArgs e) { Estacion.EstacionService estacion = estaciones[stations.SelectedItem.ToString()]; estacionActual = estacion; }