crimeplanner

Untitled

Apr 6th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1.             string json = Helper.CachedRequest("boards.json");
  2.             JavaScriptSerializer s = new JavaScriptSerializer();
  3.             Dictionary<string, object> mob = s.DeserializeObject(json) as Dictionary<string, object>;
  4.             List<Board> b = new List<Board>();
  5.             foreach (Dictionary<string, object> item in mob["boards"] as object[])
  6.             {
  7.                 b.Add(new Board()
  8.                 {
  9.                     Id = item["board"] as string,
  10.                     Title = item["title"] as string,
  11.                     Worksafe = Helper.IntToBool((int)item["ws_board"]),
  12.                     PostsPerPage = (int)item["per_page"],
  13.                     Pages = (int)item["pages"]
  14.                 });
  15.             }
  16.             return b.ToArray();
Advertisement
Add Comment
Please, Sign In to add comment