Beispiel #1
0
        /// <summary>
        /// Set genreal info for the selected movie and call methods to load additional info
        /// </summary>
        private async void setMovieInfo()
        {
            CustomMovie cm = lbMovies.SelectedItem as CustomMovie;

            if (!cm.Movie.Title.Equals(currentMovie.Title))
            {
                pbPoster.SizeMode = PictureBoxSizeMode.CenterImage;
                pbPoster.Image    = Properties.Resources.loading;
                Movie movie = await LoadMovies.GetMovie(cm);

                if (movie.ReleaseDate.HasValue)
                {
                    lblMovieTitle.Text = string.Format("{0} ({1})", movie.Title, movie.ReleaseDate.Value.Year.ToString());
                }
                else
                {
                    lblMovieTitle.Text = movie.Title;
                }
                lblRating.Text         = movie.VoteAverage.ToString("0.00");
                lblVotes.Text          = movie.VoteCount.ToString();
                pbPoster.SizeMode      = PictureBoxSizeMode.Zoom;
                pbPoster.ImageLocation = "http://image.tmdb.org/t/p/w500" + movie.Poster;
                lblDescription.Text    = movie.Overview;
                setCast(movie.Credits.Cast);
                setInfo(movie);
                setTrailer(movie.Videos.Results);
                currentMovie = movie;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Takes care of updating the label that shows the title of an upcoming movie, including the fade in/fade out effects
        /// </summary>
        private async void upcomingMoviesUpdate()
        {
            if (lblUpcoming.ForeColor == Color.FromArgb(242, 242, 242))
            {
                lblUpcoming.Text = upcoming[upcomingMovieIndex].Title;
                upcomingMovie    = await LoadMovies.GetMovie(upcoming[upcomingMovieIndex].Id);

                if (upcomingMovie == null)
                {
                    lblUpcoming.Enabled = false;
                }
                else
                {
                    lblUpcoming.Enabled = true;
                }
                if (++upcomingMovieIndex >= upcoming.Count())
                {
                    upcomingMovieIndex = 0;
                }
                upcomingInc = false;
                changeUpcomingRGB("decrement");
            }
            else if (lblUpcoming.ForeColor == Color.FromArgb(92, 92, 61))
            {
                if (upcomingInc)
                {
                    changeUpcomingRGB("increment");
                }
                else
                {
                    upcomingInc       = true;
                    timerFade.Enabled = false;
                }
            }
            else
            {
                if (!upcomingInc)
                {
                    changeUpcomingRGB("decrement");
                }
                else
                {
                    changeUpcomingRGB("increment");
                }
            }
            lblUpcoming.ForeColor = Color.FromArgb(upcomingRGB[0], upcomingRGB[1], upcomingRGB[2]);
        }