//public static void PopulateListOfMovies(ArrayList ListOfMovies) //{ // for (int i = 1; i <= 100; i++) // { // ListOfMovies.Add(MovieIO.getMovie(i)); // } //} //This adds every single movie from the MovieIO class and returns a new list. public static List <Movie> ListOfMovies() { List <Movie> returnList = new List <Movie>(); for (int i = 1; i <= 100; i++) { returnList.Add(MovieIO.getMovie(i)); } return(returnList); }
private static Hashtable LoadDynamicMovieList() { Hashtable movieList = new Hashtable(); for (int i = 1; i <= 100; i++) { Movie temp = MovieIO.getMovie(i); string cat = temp.Category; if (movieList[cat] != null)// I do have a list { List <Movie> FoundList = (List <Movie>)movieList[cat]; FoundList.Add(temp); } else { List <Movie> catList = new List <Movie>(); catList.Add(temp); movieList.Add(cat, catList); } } return(movieList); }