Пример #1
0
        /// <summary>
        /// Parse a JSON string representing reviews related to the movie
        /// </summary>
        /// <param name="json">The JSON string to be parsed</param>
        /// <returns>Movie object</returns>
        public static Movie ParseReviews(string json, Movie movie)
        {
            JObject jObject = JObject.Parse(json);

            movie.Reviews = ParseMovieReviews(jObject["reviews"]);
            return movie;
        }
Пример #2
0
 /// <summary>
 /// Parse a JSON string representing clips related to the movie
 /// </summary>
 /// <param name="json">The JSON string to be parsed</param>
 /// <returns>Movie object</returns>
 public static Movie ParseClips(string json, Movie movie)
 {
     JObject jObject = JObject.Parse(json);
                 
     movie.MovieClips = ParseMovieClips(jObject["clips"]);
     return movie;
 }
Пример #3
0
 /// <summary>
 /// Parse a JSON string representing a Movie item
 /// </summary>
 /// <param name="json">The JSON string to be parsed</param>
 /// <returns>Movie object</returns>
 public static Movie ParseMovie(string json)
 {
     JObject jObject = JObject.Parse(json);
     Movie movie = new Movie();
                 
     movie.RottenTomatoesId = ParseRottenTomatoesId(jObject["id"]);
     movie.Title = ParseTitle(jObject["title"]);
     movie.Year = ParseYear(jObject["year"]);
     movie.MpaaRating = ParseMpaaRating(jObject["mpaa_rating"]);
     movie.Runtime = ParseRunTime(jObject["runtime"]);
     movie.Synopsis = ParseSynopsis(jObject["synopsis"]);
     movie.Directors = ParseDirectors(jObject["abridged_directors"]);
     movie.Genres = ParseGenres(jObject["genres"]);
     movie.Cast = ParseCastMembers(jObject["abridged_cast"]);
     movie.Links = ParseLinks(jObject["links"]);
     movie.Posters = ParsePosters(jObject["posters"]);
     movie.Ratings = ParseRatings(jObject["ratings"]);
     movie.ReleaseDates = ParseReleaseDates(jObject["release_dates"]);
     movie.CriticsConsensus = ParseCriticsConsensus(jObject["critics_consensus"]);
     return movie;
 }
Пример #4
0
        private void DisplayClips(Movie movie)
        {
            
            List<Clip> list = new List<Clip>();

            foreach (var clip in movie.MovieClips.Clips)
            {
                if (clip.AbsoluteLink != "")
                {
                    list.Add(clip);
                }
            }

            ClipsList.ItemsSource = list;

        }
        private void DisplayMovieDetails(Movie movie)
        {
            PageTitle.Text = movie.Title;
            //Scale title to fit available area
            if (PageTitle.ActualWidth > PageTitle.Width)
            {
                PageTitle.FontSize = PageTitle.FontSize * ((double)PageTitle.Width / (double)PageTitle.ActualWidth);
            }
            AudiencePerCent.Text = movie.AudienceRatingPerCent;
            CriticsPerCent.Text = movie.CriticsRatingPerCent;
            Cast.Text = "Cast: " + movie.CastMembers;
            Directors.Text = movie.MovieDirectors;
            Genres.Text = movie.MovieGenres;
            DVD.Text = movie.DVDReleaseDate;
            InTheaters.Text = movie.TheatersReleaseDate;
            Year.Text = "Year: " + movie.Year.ToString().Replace("-1", "NA"); ;
            MPAA.Text = "MPAA Rating: " + movie.MpaaRating.Replace("-1", "NA"); ;
            Runtime.Text = "Runtime: " + movie.Runtime.ToString().Replace("-1", "NA");
            if (movie.CriticsConsensus == "")
            {
                Consensus.Text = "No critics consensus available yet...";
            }
            else
            {
                Consensus.Text = movie.CriticsConsensus;
            }

            Uri u;
            u = new Uri(movie.ImageSourcePath, UriKind.Relative);
            RatingImage.Source = new BitmapImage(u);

            u = new Uri(movie.SmallPoster, UriKind.RelativeOrAbsolute);
            poster.Source = new BitmapImage(u);

            PhoneApplicationService.Current.State["Movie"] = movie;
        }
Пример #6
0
        private void DisplayReviews(Movie movie)
        {

            List<Review> list = new List<Review>();

            foreach (var review in movie.Reviews.MovieReviews)
            {
                if (review.AbsoluteLink != "")
                {
                    list.Add(review);
                }
            }

            ReviewsList.ItemsSource = list;

        }