private void handleVideoClick(VideoAlbumInfo videoAlbum) { }
public static List<VideoAlbumInfo> ParseFacebookVideoAlbumsResponse(string responseStr) { List<VideoAlbumInfo> toReturn = new List<VideoAlbumInfo>(); if (!string.IsNullOrEmpty(responseStr)) { JsonValue responseJson = JsonValue.Parse(responseStr); if (responseJson.ContainsKey("data")) { JsonArray albumArr = (JsonArray)responseJson ["data"]; if (albumArr.Count > 0) { for (int i = 0; i < albumArr.Count; i++) { string id = albumArr [i].ContainsKey("id") ? (string)albumArr [i] ["id"] : string.Empty; string description = albumArr [i].ContainsKey("description") ? (string)albumArr [i] ["description"] : string.Empty; string pictureUrl = albumArr [i].ContainsKey("picture") ? (string)albumArr [i] ["picture"] : string.Empty; string sourceUrl = albumArr [i].ContainsKey("source") ? (string)albumArr [i] ["source"] : string.Empty; DateTime createdDate = default(DateTime); DateTime? createdDateVal = null; if (albumArr [i].ContainsKey("created_time")) { if (DateTime.TryParse((string)albumArr [i] ["created_time"], out createdDate)) { createdDateVal = createdDate; }//end if }//end try catch VideoAlbumInfo vidInfo = new VideoAlbumInfo(id, description, pictureUrl, sourceUrl, createdDateVal); toReturn.Add(vidInfo); }//end for }//end if }//end if }//end if return toReturn; }