Example #1
0
 protected virtual void DownloadDataCompleteEvent(DownloadCompleteData e)
 {
     EventHandler<DownloadCompleteData> handler = downloadDatacomplete;
     if (handler != null)
     {
         handler(this, e);
     }
 }
Example #2
0
        async void DownloadDataAsync(String url)
        {
            HttpClient client = new HttpClient();
            Task<string> getStringTask = client.GetStringAsync(url);
            string urlContents = await getStringTask;

            DownloadCompleteData data_to_send = new DownloadCompleteData();
            data_to_send.data = urlContents;

            DownloadDataCompleteEvent(data_to_send);

        }
Example #3
0
        void data_arrived(object sender, DownloadCompleteData e)
        {

            String data = e.data;

            JArray obj = JArray.Parse(data);

            for (int i = 0; i < obj.Count; i++)
            {

                JObject row = JObject.Parse(obj[i].ToString());

                var item = new DataList();
                item.country = row["country"].ToString();
                item.code = row["code"].ToString();

                list.Items.Add(item);
            }


        }