private void WishList_Load(object sender, System.EventArgs e)
        {
            foreach (string imdb in Properties.Settings.Default.WishList)
            {
                string url = OMDB.imdbAddress + imdb + "&apikey=" + OMDB.api;

                using (WebClient wc = new WebClient())
                {
                    string json = wc.DownloadString(url);

                    JavaScriptSerializer oJS      = new JavaScriptSerializer();
                    ImdbEntity_S         Entity_S = oJS.Deserialize <ImdbEntity_S>(json);

                    MovieUC MovieUserControl = new MovieUC(Entity_S.imdbID, Entity_S.Title, Entity_S.Year, Entity_S.Poster, Entity_S.Type, Main.TitleInWishList(Entity_S.imdbID), Main.TitleInSeenList(Entity_S.imdbID), Main);
                    MoviesFLP.Controls.Add(MovieUserControl);
                }
            }
        }
        private void MovieInfo_Load(object sender, EventArgs e)
        {
            string url = OMDB.imdbAddress + imdbId + "&apikey=" + OMDB.api;

            using (WebClient wc = new WebClient())
            {
                string json = wc.DownloadString(url);

                JavaScriptSerializer oJS      = new JavaScriptSerializer();
                ImdbEntity_S         Entity_S = oJS.Deserialize <ImdbEntity_S>(json);
                var movies = oJS.Serialize(Entity_S);

                if (Entity_S.Response == "True")
                {
                    PosterPb.ImageLocation = Entity_S.Poster;
                    ResultsLb.Items.Add("Title: " + Entity_S.Title);
                    ResultsLb.Items.Add("Year: " + Entity_S.Year);
                    ResultsLb.Items.Add("Type: " + Entity_S.Type);
                    ResultsLb.Items.Add("Rated: " + Entity_S.Rated);
                    ResultsLb.Items.Add("Released: " + Entity_S.Released);
                    ResultsLb.Items.Add("Runtime: " + Entity_S.Runtime);
                    ResultsLb.Items.Add("Genre: " + Entity_S.Genre);
                    ResultsLb.Items.Add("Directors: " + Entity_S.Director);
                    ResultsLb.Items.Add("Writer: " + Entity_S.Writer);
                    ResultsLb.Items.Add("Actors: " + Entity_S.Actors);
                    ResultsLb.Items.Add("Plot: " + Entity_S.Plot);
                    ResultsLb.Items.Add("Language: " + Entity_S.Language);
                    ResultsLb.Items.Add("Country: " + Entity_S.Country);
                    ResultsLb.Items.Add("Awards: " + Entity_S.Awards);
                    ResultsLb.Items.Add("Metascore: " + Entity_S.Metascore);
                    ResultsLb.Items.Add("IMDB ID: " + Entity_S.imdbID);
                    ResultsLb.Items.Add("IMDB Rating: " + Entity_S.imdbRating);
                    ResultsLb.Items.Add("IMDB Votes: " + Entity_S.imdbVotes);
                }
                else
                {
                    MessageBox.Show("There was an error requesting movie data", "Error");
                }
            }
        }
        private void ThreadBW_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            if (apiSelect == 0)
            {
                string url = string.Empty;

                if (!isSingle)
                {
                    url = OMDB.multipleAddress + SearchTb.Text.Trim() + "&apikey=" + OMDB.api;
                }
                else
                {
                    url = OMDB.singleAddress + SearchTb.Text.Trim() + "&apikey=" + OMDB.api;
                }
                using (WebClient wc = new WebClient())
                {
                    string        json   = wc.DownloadString(url);
                    List <string> imdbId = new List <string>();

                    JavaScriptSerializer oJS = new JavaScriptSerializer();

                    if (!isSingle)
                    {
                        Entity_M = oJS.Deserialize <ImdbEntity_M>(json);
                        var movies = oJS.Serialize(Entity_M);

                        if (Entity_M.Response == "True")
                        {
                            foreach (var movie in Entity_M.Search)
                            {
                                MovieUC MovieUserControl = new MovieUC(movie.imdbID, movie.Title, movie.Year, movie.Poster,
                                                                       movie.Type, TitleInWishList(movie.imdbID), TitleInSeenList(movie.imdbID), this);

                                imdbId.Add(movie.imdbID);

                                MoviesFLP.Invoke(new MethodInvoker(delegate
                                {
                                    MoviesFLP.Controls.Add(MovieUserControl);
                                }));
                            }
                        }
                        else
                        {
                            MessageBox.Show("There was an error requesting movie data", "Error");
                        }
                    }
                    else
                    {
                        Entity_S = oJS.Deserialize <ImdbEntity_S>(json);

                        if (Entity_S.Response == "True")
                        {
                            MovieUC MovieUserControl = new MovieUC(Entity_M.imdbID, Entity_S.Title, Entity_S.Year, Entity_S.Poster,
                                                                   Entity_S.Type, TitleInWishList(Entity_S.imdbID), TitleInSeenList(Entity_S.imdbID), this);

                            imdbId.Add(Entity_M.imdbID);

                            MoviesFLP.Invoke(new MethodInvoker(delegate
                            {
                                MoviesFLP.Controls.Add(MovieUserControl);
                            }));
                        }
                        else
                        {
                            MessageBox.Show("There was an error requesting movie data", "Error");
                        }
                    }
                    SeenListUserControl = new SeenListUC(NumberOfMoviesSeenInSearchCategory(imdbId), this);
                    MoviesFLP.Invoke(new MethodInvoker(delegate
                    {
                        MoviesFLP.Controls.Add(SeenListUserControl);
                    }));

                    WishListUserControl = new WishListUC(Properties.Settings.Default.WishList.Count, this);
                    MoviesFLP.Invoke(new MethodInvoker(delegate
                    {
                        MoviesFLP.Controls.Add(WishListUserControl);
                    }));
                }
            }
            else if (apiSelect == 1)
            {
                string url = string.Empty;

                if (!isSingle)
                {
                    url = TMDB.multipleAddress + "search/movie?api_key=" + TMDB.api + "&query=" + SearchTb.Text.Trim();
                }
                else
                {
                    url = TMDB.singleAddress + "search/movie?api_key=" + TMDB.api + "&query=" + SearchTb.Text.Trim();
                }
                using (WebClient wc = new WebClient())
                {
                    string        json    = wc.DownloadString(url);
                    List <string> imdb_id = new List <string>();

                    JavaScriptSerializer oJS = new JavaScriptSerializer();

                    if (!isSingle)
                    {
                        entity_Tmdb = oJS.Deserialize <TmdbEntity>(json);
                        var movies = oJS.Serialize(entity_Tmdb);

                        if (movies != null)
                        {
                            foreach (var movie in entity_Tmdb.results)
                            {
                                MovieUC MovieUserControl = new MovieUC(movie.id, movie.title, movie.release_date, TMDB.posterUrl + movie.poster_path,
                                                                       "Movie", TitleInWishList(movie.imdb_id), TitleInSeenList(movie.imdb_id), this);

                                imdb_id.Add(movie.imdb_id);

                                MoviesFLP.Invoke(new MethodInvoker(delegate
                                {
                                    MoviesFLP.Controls.Add(MovieUserControl);
                                }));
                            }
                        }
                        else
                        {
                            MessageBox.Show("There was an error requesting movie data", "Error");
                        }
                    }
                    else
                    {
                        TMDB_entity_S = oJS.Deserialize <TmdbEntity_S>(json);

                        if (TMDB_entity_S.imdb_id != null)
                        {
                            string imdbID = TMDB_entity_S.imdb_id;
                            string Title  = TMDB_entity_S.original_title;
                            string Year   = TMDB_entity_S.release_date;
                            string Poster = TMDB_entity_S.poster_path;
                            string Type   = TMDB_entity_S.genres;

                            MovieUC MovieUserControl = new MovieUC(imdbID, Title, Year, Poster,
                                                                   Type, TitleInWishList(imdbID), TitleInSeenList(imdbID), this);

                            imdb_id.Add(TMDB_entity_S.imdb_id);

                            MoviesFLP.Invoke(new MethodInvoker(delegate
                            {
                                MoviesFLP.Controls.Add(MovieUserControl);
                            }));
                        }
                        else
                        {
                            MessageBox.Show("There was an error requesting movie data", "Error");
                        }
                    }
                    SeenListUserControl = new SeenListUC(NumberOfMoviesSeenInSearchCategory(imdb_id), this);
                    MoviesFLP.Invoke(new MethodInvoker(delegate
                    {
                        MoviesFLP.Controls.Add(SeenListUserControl);
                    }));

                    WishListUserControl = new WishListUC(Properties.Settings.Default.WishList.Count, this);
                    MoviesFLP.Invoke(new MethodInvoker(delegate
                    {
                        MoviesFLP.Controls.Add(WishListUserControl);
                    }));
                }
            }
        }