Exemple #1
0
 internal void Parse(dynamic json, bool isAbbrev = false)
 {
     Id    = DynamicJsonObject.ParseIntFromDyn(json.id);
     Title = json.title;
     Year  = DynamicJsonObject.ParseIntFromDyn(json.year);
     if (isAbbrev)
     {
         Genres            = null;
         AbridgedDirectors = null;
     }
     else
     {
         Genres = new List <string>();
         foreach (var g in json.genres)
         {
             Genres.Add(g);
         }
         if (json.abridged_directors == null)
         {
             AbridgedDirectors = null;
         }
         else
         {
             AbridgedDirectors = new List <string>();
             foreach (var ad in json.abridged_directors)
             {
                 AbridgedDirectors.Add(ad.name);
             }
         }
     }
     MPAARating   = json.mpaa_rating;
     Runtime      = DynamicJsonObject.ParseIntFromDyn(json.runtime);
     ReleaseDates = new ReleaseDates(json.release_dates);
     Ratings      = new Ratings(json.ratings);
     Synopsis     = json.synopsis;
     Posters      = new Posters(json.posters);
     AbridgedCast = new List <CastMember>();
     foreach (var ac in json.abridged_cast)
     {
         AbridgedCast.Add(new CastMember(ac));
     }
     Links      = new MovieLinks(json.links);
     IsAbridged = isAbbrev;
 }
 internal void Parse(dynamic json, bool isAbbrev = false) {
     Id = DynamicJsonObject.ParseIntFromDyn(json.id);
     Title = json.title;
     Year = DynamicJsonObject.ParseIntFromDyn(json.year);
     if (isAbbrev) {
         Genres = null;
         AbridgedDirectors = null;
     }
     else {
         Genres = new List<string>();
         foreach (var g in json.genres)
             Genres.Add(g);
         if (json.abridged_directors == null)
             AbridgedDirectors = null;
         else {
             AbridgedDirectors = new List<string>();
             foreach (var ad in json.abridged_directors)
                 AbridgedDirectors.Add(ad.name);
         }
     }
     MPAARating = json.mpaa_rating;
     Runtime = DynamicJsonObject.ParseIntFromDyn(json.runtime);
     ReleaseDates = new ReleaseDates(json.release_dates);
     Ratings = new Ratings(json.ratings);
     Synopsis = json.synopsis;
     Posters = new Posters(json.posters);
     AbridgedCast = new List<CastMember>();
     foreach (var ac in json.abridged_cast)
         AbridgedCast.Add(new CastMember(ac));
     Links = new MovieLinks(json.links);
     IsAbridged = isAbbrev;
 }