//methods public void LoadAgencies() { AgencyList = new List<Agency>(); XmlElement XmlAgencies = new NBHelper().NextBusWebRequest("http://webservices.nextbus.com/service/publicXMLFeed?command=agencyList"); foreach (XmlElement a in XmlAgencies.ChildNodes) { //Create new Agency AgencyList.Add(new Agency(a)); } }
//method get BusRoutes public void getBusRoutes() { ////http://webservices.nextbus.com/service/publicXMLFeed?command=routeList&a= +"tag" ADD AGENCY TAG HERE IMPORTANT List<Route> busRoutes = new List<Route>(); busRouteTitles = new List<string>(); XmlElement XmlAgencies = new NBHelper().NextBusWebRequest("http://webservices.nextbus.com/service/publicXMLFeed?command=routeList&a=" + tag); foreach (XmlElement childNode in XmlAgencies.ChildNodes) { Route myRoute = new Route(childNode); busRoutes.Add(myRoute); //Console.WriteLine(childNode.Attributes["title"].Value); busRouteTitles.Add(myRoute.title); } }