private void parseMenu(DiningHall diningHall, string xmlMenu) { XElement XML = XElement.Parse(xmlMenu); XElement Menu = XML.Element("menu"); XElement Breakfast = Menu.Element("meal"); IEnumerable<XElement> BCourses = Breakfast.Elements("course"); IEnumerable<XElement> Food = BCourses.Elements("menuitem"); foreach (XElement food in Food) { XElement Name = food.Element("name"); diningHall.addtoMenu(0, Name.Value); } XElement Lunch = (XElement)Breakfast.NextNode; IEnumerable<XElement> LCourses = Lunch.Elements("course"); IEnumerable<XElement> LFood = LCourses.Elements("menuitem"); foreach (XElement food in LFood) { XElement Name = food.Element("name"); diningHall.addtoMenu(1, Name.Value); } XElement Dinner = (XElement)Lunch.NextNode; IEnumerable<XElement> DCourses = Dinner.Elements("course"); IEnumerable<XElement> DFood = DCourses.Elements("menuitem"); foreach (XElement food in DFood) { XElement Name = food.Element("name"); diningHall.addtoMenu(2, Name.Value); } }
public BigData() { this._diningHallList = new List<DiningHall>(); this._searchResults = new List<SearchHit>(); foreach (string name in BigData.hallNames) { var newDiningHall = new DiningHall(name); string url = _createURL(this._curDate, this._diningHallList.Count()); this._diningHallList.Add(newDiningHall); } }