コード例 #1
0
ファイル: Nextbus1.cs プロジェクト: StevensPAE/PAE810
 //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));
     }
 }
コード例 #2
0
ファイル: Agency.cs プロジェクト: StevensPAE/PAE810
        //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);
            }
        }