Advertisement
L_B

SO9986434

L_B
Apr 3rd, 2012
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.36 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Net;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using Newtonsoft.Json;
  11.  
  12. namespace WindowsFormsApplication1
  13. {
  14.     public partial class Form7 : Form
  15.     {
  16.         public Form7()
  17.         {
  18.             InitializeComponent();
  19.         }
  20.  
  21.         private void Form7_Load(object sender, EventArgs e)
  22.         {
  23.  
  24.             WebClient web = new WebClient();
  25.             string result = web.DownloadString("http://api.beatport.com/catalog/3/beatport/home");
  26.  
  27.             NewReleasesCharts homeData = JsonConvert.DeserializeObject<NewReleasesCharts>(result);
  28.         }
  29.  
  30.         public class NewReleasesCharts //Root Object
  31.         {
  32.             //public Metadata metadata { get; set; }
  33.             public ResultHome results = new ResultHome();
  34.             public IEnumerator<ResultHome> GetEnumerator()
  35.             {
  36.                 return this.results.GetEnumerator();
  37.             }
  38.         }
  39.         public class ResultHome
  40.         {
  41.             public List<FeaturedReleases> featuredReleases { get; set; }
  42.  
  43.             //public List<FeaturedCharts> featuredCharts { get; set; }
  44.             //public List<TopDownloads> topdownloads { get; set; }
  45.             //public List<MostPopularReleases> mostPopularReleases { get; set; }
  46.             //public List<Components> components { get; set; }
  47.  
  48.             internal IEnumerator<ResultHome> GetEnumerator()
  49.             {
  50.                 throw new NotImplementedException();
  51.             }
  52.         }
  53.  
  54.         public class FeaturedReleases
  55.         {
  56.             public int id { get; set; }
  57.             public string type { get; set; }
  58.             public string name { get; set; }
  59.             public string slug { get; set; }
  60.             public ReleaseImage images { get; set; }
  61.         }
  62.  
  63.         public class ReleaseImage
  64.         {
  65.             //public ReleaseSmall small { get; set; }
  66.             public ReleaseMedium medium { get; set; }
  67.             //public ReleaseLarge large { get; set; }
  68.         }
  69.  
  70.         public class ReleaseMedium
  71.         {
  72.             public int width { get; set; }
  73.             public int height { get; set; }
  74.             public string url { get; set; }
  75.             public string secureUrl { get; set; }
  76.         }  
  77.     }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement