public static ArrayOfObjStation GetAllStationCodes()
 {
     try
     {
         ArrayOfObjStation StationList = new ArrayOfObjStation();
         XmlDocument       maindoc     = new XmlDocument();
         using (var httpClient = CreateClient())
         {
             string URL = "http://api.irishrail.ie/realtime/realtime.asmx/getAllStationsXML";
             maindoc.Load(URL);
             XmlSerializer serializer = new XmlSerializer(typeof(ArrayOfObjStation));
             using (var reader = new StringReader(maindoc.InnerXml))
             {
                 StationList = (ArrayOfObjStation)serializer.Deserialize(reader);
             }
         }
         return(StationList);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
示例#2
0
 private async void btnLogin_ClickedAsync(object sender, EventArgs e)
 {
     IrishStationList     = StationData.GetAllStationCodes();
     App.Current.MainPage = new AppPage();
 }