Esempio n. 1
0
        public void loadSearch()
        {
            MovieTeiApiSearch   obj    = new MovieTeiApiSearch(searchQuery);
            IEnumerable <Movie> movies = obj.Search();

            if (movies == null)
            {
                return;
            }

            /* if(movies == null)
             * {
             *   Movie obj2 = new Movie();
             *   List <Movie> mylist = obj2.omdbApiSearch(searchQuery);
             *   if(mylist == null) { return; }
             *   foreach(Movie m in mylist)
             *   {
             *       SingleMovieContainer movieContainer = new SingleMovieContainer(MainWindow, m) { TopLevel = false, TopMost = true };
             *       searchFlowPanel.Controls.Add(movieContainer);
             *       movieContainer.Show();
             *   }
             *   return;
             * }*/

            for (int i = 0; i < movies.Count() - 1; i++)
            {
                SingleMovieContainer movieContainer = new SingleMovieContainer(MainWindow, movies.ElementAt(i))
                {
                    TopLevel = false, TopMost = true
                };
                searchFlowPanel.Controls.Add(movieContainer);
                movieContainer.Show();
            }
        }
Esempio n. 2
0
        //load home movies
        public void loadHome()
        {
            //load Top Movies
            Movie        obj       = new Movie();
            List <Movie> topMovies = obj.getTopMovies();

            foreach (Movie movie in topMovies)
            {
                SingleMovieContainer movieContainer = new SingleMovieContainer(MainWindow, movie)
                {
                    TopLevel = false, TopMost = true
                };
                flowPanelTopMovies.Controls.Add(movieContainer);
                movieContainer.Show();
            }

            //load 10 movies
            List <Movie> newMovies = obj.getMovies(10, "desc");

            foreach (Movie movie in newMovies)
            {
                SingleMovieContainer movieContainer = new SingleMovieContainer(MainWindow, movie)
                {
                    TopLevel = false, TopMost = true
                };
                flowPanelNewReleases.Controls.Add(movieContainer);
                movieContainer.Show();
            }
        }
Esempio n. 3
0
 public void Recommendations()
 {
     if (userID == 0)//Guest
     {
         recommendedLabel.Text = "Featured Movies";
         //load 10 movies
         Movie        obj       = new Movie();
         List <Movie> newMovies = obj.getMovies(20, "desc");
         for (int i = 10; i < 20; i++)
         {
             SingleMovieContainer movieContainer = new SingleMovieContainer(MainWindow, newMovies[i])
             {
                 TopLevel = false, TopMost = true
             };
             flowPanelRecommended.Controls.Add(movieContainer);
             movieContainer.Show();
         }
     }
     else //User logged in
     {
         try
         {
             recommendedLabel.Text = "Recommended For You ";
             MovieTeiApiRecommends obj = new MovieTeiApiRecommends(userID);
             IEnumerable <Movie>   mov = obj.recommends();
             if (mov == null)
             {
                 return;
             }
             foreach (Movie m in mov)
             {
                 SingleMovieContainer movieContainer = new SingleMovieContainer(MainWindow, m)
                 {
                     TopLevel = false, TopMost = true
                 };
                 flowPanelRecommended.Controls.Add(movieContainer);
                 movieContainer.Show();
             }
         }catch (Exception e)
         {
             Debug.WriteLine(e.Message);
         }
     }
 }
Esempio n. 4
0
        public void loadSearch2()
        {
            Movie        obj2   = new Movie();
            List <Movie> mylist = obj2.omdbApiSearch(searchQuery);

            if (mylist == null)
            {
                return;
            }
            foreach (Movie m in mylist)
            {
                SingleMovieContainer movieContainer = new SingleMovieContainer(MainWindow, m)
                {
                    TopLevel = false, TopMost = true
                };
                searchFlowPanel.Controls.Add(movieContainer);
                movieContainer.Show();
            }
        }
Esempio n. 5
0
 //Load Recommended}
 public void loadRecommended()
 {
     if (userID == 0)//Guest
     {
         recommendedLabel.Text = "Featured Movies";
         //load 10 movies
         Movie        obj       = new Movie();
         List <Movie> newMovies = obj.getMovies(20, "desc");
         for (int i = 10; i < 20; i++)
         {
             SingleMovieContainer movieContainer = new SingleMovieContainer(MainWindow, newMovies[i])
             {
                 TopLevel = false, TopMost = true
             };
             flowPanelRecommended.Controls.Add(movieContainer);
             movieContainer.Show();
         }
     }
     else //User logged in
     {
         recommendedLabel.Text = "Recommended For You - " + MainWindow.getUserGenre();
     }
 }