public static void Copy(RottenTomatoesMovies response, string groupId, string groupName)
        {
            try
            {
                MovieGroup movieGroup = RottenTomatoesCollection.GetGroupByTitle(groupName);
                if (movieGroup != null)
                    movieGroup.Items.Clear();
                else
                    movieGroup = new MovieGroup(groupId, groupName, response.Movies[0].Posters.Original);

                foreach (var movieItem in response.Movies.Select(movie => new MovieItem(
                    movie.Id,
                    movie.Title,
                    movie.MPAARating,
                    movie.Ratings.AudienceRating,
                    movie.Ratings.CriticsRating,
                    movie.Links.Clips,
                    movie.Links.Reviews,
                    movie.Links.Cast,
                    movie.Posters.Original,
                    movie.Synopsis,
                    movieGroup)))
                {
                    movieGroup.Items.Add(movieItem);
                }
                _movieData._allGroups.Add(movieGroup);
            }
            catch (Exception e)
            {
                throw;
            }
        }
        public static void Copy(RottenTomatoesMovies response, string groupId, string groupName)
        {
            try
            {
                MovieGroup movieGroup = RottenTomatoesCollection.GetGroupByTitle(groupName);
                if (movieGroup != null)
                {
                    movieGroup.Items.Clear();
                }
                else
                {
                    movieGroup = new MovieGroup(groupId, groupName, response.Movies[0].Posters.Original);
                }

                foreach (var movieItem in response.Movies.Select(movie => new MovieItem(
                                                                     movie.Id,
                                                                     movie.Title,
                                                                     movie.MPAARating,
                                                                     movie.Ratings.AudienceRating,
                                                                     movie.Ratings.CriticsRating,
                                                                     movie.Links.Clips,
                                                                     movie.Links.Reviews,
                                                                     movie.Links.Cast,
                                                                     movie.Posters.Original,
                                                                     movie.Synopsis,
                                                                     movieGroup)))
                {
                    movieGroup.Items.Add(movieItem);
                }
                _movieData._allGroups.Add(movieGroup);
            }
            catch (Exception e)
            {
                throw;
            }
        }
Пример #3
0
 public MovieItem(string uniqueId, string title, string rating, string audienceScore, string criticsScore, string clips, string reviews, string cast, string imagePath, string description, MovieGroup movieGroup)
     : base(uniqueId, title, rating, audienceScore, criticsScore, clips, reviews, cast, imagePath, description)
 {
     this._movieGroup = movieGroup;
 }
Пример #4
0
 public MovieItem(string uniqueId, string title, string rating, string audienceScore, string criticsScore, string clips, string reviews, string cast, string imagePath, string description, MovieGroup movieGroup)
     : base(uniqueId, title, rating, audienceScore, criticsScore, clips, reviews, cast, imagePath, description)
 {
     this._movieGroup = movieGroup;
 }