public void BuildBox(ComboBox cityBox, ComboBox cinemaBox, ComboBox movieBox, ComboBox dateBox, ComboBox timeBox, ComboBox priceBox) { IStrategy p = new LINQToXML(); List <Films> res = p.AnalyzeFile(new Films(), path); List <string> city = new List <string>(); List <string> cinema = new List <string>(); List <string> movie = new List <string>(); List <string> date = new List <string>(); List <string> time = new List <string>(); List <string> price = new List <string>(); foreach (Films elem in res) { if (!city.Contains(elem.city)) { city.Add(elem.city); } if (!cinema.Contains(elem.cinema)) { cinema.Add(elem.cinema); } if (!movie.Contains(elem.movie)) { movie.Add(elem.movie); } if (!date.Contains(elem.date)) { date.Add(elem.date); } if (!time.Contains(elem.time)) { time.Add(elem.time); } if (!price.Contains(elem.price)) { price.Add(elem.price); } } city = city.OrderBy(x => x).ToList(); cinema = cinema.OrderBy(x => x).ToList(); movie = movie.OrderBy(x => x).ToList(); date = date.OrderBy(x => x).ToList(); time = time.OrderBy(x => x).ToList(); price = price.OrderBy(x => x).ToList(); cityBox.Items.AddRange(city.ToArray()); cinemaBox.Items.AddRange(cinema.ToArray()); movieBox.Items.AddRange(movie.ToArray()); dateBox.Items.AddRange(date.ToArray()); timeBox.Items.AddRange(time.ToArray()); priceBox.Items.AddRange(price.ToArray()); }
private void Parsing4XML() { Films myTemplate = OurSearch(); List <Films> res; if (radioDOM.Checked) { IStrategy parser = new DOM(); res = parser.AnalyzeFile(myTemplate, path); Output(res); } else if (radioSAX.Checked) { IStrategy parser = new SAX(); res = parser.AnalyzeFile(myTemplate, path); Output(res); } else if (radioLINQ.Checked) { IStrategy parser = new LINQToXML(); res = parser.AnalyzeFile(myTemplate, path); Output(res); } }