Ejemplo n.º 1
0
        public void HentFlygninger(Flyplass flyplass, Action <List <Flygning> > callback)
        {
            string url = "http://flydata.avinor.no/XmlFeed.asp?TimeFrom=1&TimeTo=7&airport=" + flyplass.Kode;

            var webRequest = (HttpWebRequest)WebRequest.Create(url);

            webRequest.BeginGetResponse(responseResult =>
            {
                try
                {
                    var response = webRequest.EndGetResponse(responseResult);
                    if (response != null)
                    {
                        var result = ParseXml(response);
                        response.Close();
                        Deployment.Current.Dispatcher.BeginInvoke(() => callback(result));
                    }
                }
                catch (Exception)
                {
                }
            }, webRequest);
        }
Ejemplo n.º 2
0
        public void HentFlygninger(Flyplass flyplass, Action<List<Flygning>> callback)
        {
            string url = "http://flydata.avinor.no/XmlFeed.asp?TimeFrom=1&TimeTo=7&airport=" + flyplass.Kode;

            var webRequest = (HttpWebRequest)WebRequest.Create(url);

            webRequest.BeginGetResponse(responseResult =>
            {
                try
                {
                    var response = webRequest.EndGetResponse(responseResult);
                    if (response != null)
                    {
                        var result = ParseXml(response);
                        response.Close();
                        Deployment.Current.Dispatcher.BeginInvoke(() => callback(result));
                    }
                }
                catch (Exception)
                {

                }
            }, webRequest);
        }