public void buildBox(ComboBox countryBox, ComboBox costBox, ComboBox markaBox, ComboBox modelBox, ComboBox yearBox, ComboBox colorBox) { IStrategy p = new LINQ(); List <Auto> res = p.AnalyzeFile(new Auto(), path); List <string> country = new List <string>(); List <string> cost = new List <string>(); List <string> marka = new List <string>(); List <string> model = new List <string>(); List <string> year = new List <string>(); List <string> color = new List <string>(); foreach (Auto elem in res) { if (!country.Contains(elem.country)) { country.Add(elem.country); } if (!cost.Contains(elem.cost)) { cost.Add(elem.cost); } if (!marka.Contains(elem.marka)) { marka.Add(elem.marka); } if (!model.Contains(elem.model)) { model.Add(elem.model); } if (!year.Contains(elem.year)) { year.Add(elem.year); } if (!color.Contains(elem.color)) { color.Add(elem.color); } } country = country.OrderBy(x => x).ToList(); cost = cost.OrderBy(x => x).ToList(); marka = marka.OrderBy(x => x).ToList(); model = model.OrderBy(x => x).ToList(); year = year.OrderBy(x => x).ToList(); color = color.OrderBy(x => x).ToList(); countryBox.Items.AddRange(country.ToArray()); costBox.Items.AddRange(cost.ToArray()); markaBox.Items.AddRange(marka.ToArray()); modelBox.Items.AddRange(model.ToArray()); yearBox.Items.AddRange(year.ToArray()); colorBox.Items.AddRange(color.ToArray()); }
private void ParsingForXML() { Auto myTemplate = OurSearch(); List <Auto> res; if (radioButtonSAX.Checked) { IStrategy parser = new SAX(); res = parser.AnalyzeFile(myTemplate, path); Output(res); } else if (radioButtonDOM.Checked) { IStrategy parser = new DOM(); res = parser.AnalyzeFile(myTemplate, path); Output(res); } else if (radioButtonLINQ.Checked) { IStrategy parser = new LINQ(); res = parser.AnalyzeFile(myTemplate, path); Output(res); } }