static City getChosenCity() { City[] cities = service.GetCities(); int city_id = 0; foreach (City city in cities) { Console.WriteLine("" + city_id++ + " - " + city.Name); } Console.WriteLine("\n\n"); Console.WriteLine("Choisissez l'une des villes disponibles précédentes."); int choise = int.Parse(Console.ReadLine()); return(cities[choise]); }
public Form1() { InitializeComponent(); service = new VelibOperationClient(); cities = service.GetCities(); }