public void Form2_Load(object sender, EventArgs e) { directori = SolicitarDirectori(); if (directori != null) { using (System.IO.StreamReader sr = new System.IO.StreamReader(directori)) { regions = XML.obtenerDadesXML(sr, "regions", "Region", "nameRegion"); planetas = XML.obtenerDadesXML(sr, "planets", "planet", "name"); planetas = Dades.dadesTotalsPlanetes(planetas); foreach (string val in regions.Keys) { comboBox1.Items.Add(val); } } } }
private void button1_Click(object sender, EventArgs e) { SolicitarDirectori(); if (directori != null) { using (System.IO.StreamReader sr = new System.IO.StreamReader(directori)) { rutas = XML.obtenerDadesXML(sr, "hyperspaceRoutes", "Route", "nameRoute"); planetas = XML.obtenerDadesXML(sr, "planets", "planet", "name"); planetas = Dades.dadesTotalsPlanetes(planetas); foreach (string val in planetas.Keys) { comboBox1.Items.Add(val); } } } }