예제 #1
0
        private Movie getMovie(MoviePreview selectedMovie)
        {
            string       link = selectedMovie.PageLink;
            HtmlWeb      web  = new HtmlWeb();
            HtmlDocument doc  = web.Load(link);

            extractMovieDetails(doc);
            Movie movie = new Movie(movieName, moviePlot, movieYear, movieGenre, movieCast);

            return(movie);
        }
예제 #2
0
 /// <summary>
 /// Gather all the data from the movie table, build a MoviePreview object and add it to moviesFound list
 /// </summary>
 private void addMoviesToList()
 {
     foreach (DataRow row in movieTable.Rows)
     {
         string icon     = (string)row[0];
         string name     = (string)row[1];
         int    year     = (int)(row[2]);
         string pageLink = (string)row[3];
         //create the MoviePreview object
         MoviePreview movie = new MoviePreview(name, icon, year, pageLink);
         moviesFound.Add(movie);
     }
 }
예제 #3
0
        public void addMovieToCollection(MoviePreview selectedMovie)
        {
            movieName = selectedMovie.MovieName;
            movieYear = selectedMovie.YearReleased;
            Movie movieToAdd = getMovie(selectedMovie);

            //check if the movie already exist in our collection
            if (!myCollection.Contains(movieToAdd))
            {
                myCollection.Add(movieToAdd);
            }
            else
            {
                MessageBox.Show(String.Format("The movie {0} is already in the list", movieToAdd));
            }
        }